What is the feature or problem you’d like to solve?
I propose adding a new tool, search_metric_descriptors, to the observability-mcp package to improve how users and agents find the correct Google Cloud metrics.
Currently, the listMetricDescriptors tool relies on the official Monitoring API filter parameter. This API filter is strict and only supports starts_with or exact matches on the metric.type (the long path string). It does not support searching by human-readable keywords in the description or display_name fields.
Why do you need this feature?
- Reduce Hallucinations: LLMs often invent metric names that sound plausible but don't exist. A fuzzy search tool allows the agent to "look up" the real name before constructing a query.
- Bridge the Semantic Gap: Users think in concepts ("CPU," "Memory," "Errors"), but the API requires specific schema paths. This tool connects natural language intents to technical schema names.
- Unlock Rich Metadata: The API contains rich
description text for every metric. This tool would allow the agent to search that text to find the most relevant metric for a specific debugging scenario.
Example prompts, workflows, or additional information
Example Workflows:
- User: "Find a metric for disk errors on my VM."
- Agent: Calls
search_metric_descriptors(query="disk error", service_prefix="compute").
- Tool: Fetches broad compute metrics -> Filters client-side for "disk" AND "error" in
description -> Returns compute.googleapis.com/guest/disk/operation_errors_count.
- User: "What metrics do you have for Redis memory?"
- Agent: Calls
search_metric_descriptors(query="memory", service_prefix="redis").
- Tool: Returns sorted list including
redis.googleapis.com/stats/memory/usage.
Implementation Plan:
This tool should implement a "Smart Search" logic:
- Broad Fetch: Use the API to fetch a set of descriptors (optionally filtered by a
service_prefix like "compute" or "kubernetes" to reduce payload size).
- Client-Side Scoring: iterate through the results and apply a fuzzy matching or scoring algorithm against the user's
query.
- Weight matches in
display_name higher than description.
- Return the top 10-20 most relevant results to the agent.
References:
What is the feature or problem you’d like to solve?
I propose adding a new tool,
search_metric_descriptors, to theobservability-mcppackage to improve how users and agents find the correct Google Cloud metrics.Currently, the
listMetricDescriptorstool relies on the official Monitoring APIfilterparameter. This API filter is strict and only supportsstarts_withor exact matches on themetric.type(the long path string). It does not support searching by human-readable keywords in thedescriptionordisplay_namefields.Why do you need this feature?
descriptiontext for every metric. This tool would allow the agent to search that text to find the most relevant metric for a specific debugging scenario.Example prompts, workflows, or additional information
Example Workflows:
search_metric_descriptors(query="disk error", service_prefix="compute").description-> Returnscompute.googleapis.com/guest/disk/operation_errors_count.search_metric_descriptors(query="memory", service_prefix="redis").redis.googleapis.com/stats/memory/usage.Implementation Plan:
This tool should implement a "Smart Search" logic:
service_prefixlike "compute" or "kubernetes" to reduce payload size).query.display_namehigher thandescription.References:
filterfield).