Challenge 5: MCP: Universal Tooling

Previous Challenge Next Challenge

Introduction

We have built and referenced our own tool in the second challenge, but what about using tools developed by others? This is where the Model Context Protocol (MCP) plays a role; it offers a standardized method for agents to comprehend and engage with the functionalities of external tools and services developed by others. This is vital as it empowers agents to expand their capabilities by using other pre-packaged tools.

There’s a plethora of various MCP Tool providers (for example see this list), which can run locally as well as remotely. For this challenge we’ll use a sample tool that we have developed for this hack using FastMCP library and running remotely on Cloud Run.

In this challenge we’ll make sure that idle resources are tagged so that we can give the developers time to verify if we can stop them. In order to do that we’ll use an MCP tool that adds a new label with a termination date in the future to the idle resource.

Description

We have already provided a service called mcp-server on Cloud Run. It provides a number of tools that are basically responsible for managing the labels on resources.

Create a new agent resource_labeler_agent, configure it to use the toolset from that server. Instruct the agent to add the janitor-scheduled label with the value set to 7 days in the future to the idle instances. Make sure that the agent does not add the label if the instance already has a janitor-scheduled label.

Then add the resource_labeler_agent to the orchestrator_agent sequence.

Success Criteria

  • The Agent runs resource_scanner_agent, resource_monitor_agent and resource_labeler_agent in sequence.
  • The instances gce-dev-lnx-tomcat-001, gce-dev-lnx-tomcat-002 have the label janitor-scheduled with the value set to 7 days in the future.
  • The instance gce-sbx-lnx-blob-001 is not updated and keeps janitor-scheduled label set to yesterday.
  • The changes have been pushed to the remote Git repository.

Learning Resources

Tips

  • You can use a proxy to simplify the authentication for the Cloud Run service.
  • You can verify the list by navigating to the VM Instances page in the Google Cloud Console or by using the gcloud compute instances describe command in Cloud Shell.
  • LLMs have no understanding of the current date and can struggle with date arithmetic, you might want to use additional tools.
  • If anything goes wrong with the labels, you can use the provided reset-labels.sh script to reset the labels to their original state.

Previous Challenge Next Challenge