Skip to main content

How do I monitor MCP tool usage and failures?

Summary

  • Monitor MCP tools at the gateway, not inside each server: when every tools/list and tools/call request passes through one governed layer, each call is logged with the caller, the server, the tool name and the result.
  • On Databricks, Unity Gateway logs MCP requests to the system.ai_gateway.usage system table with service_type = 'MCP_SERVICE', and its mcp_metadata field records the tool name, server type and JSON-RPC method.
  • The built-in usage dashboard has an External MCP Server tab for request volume, error rates, users and connections, and every MCP call is also written to the audit log as mcpCall.
  • For failure detail, the unified trace table (Beta) records MCP spans with tool arguments, results, the JSON-RPC status code and an error classification such as policy_deny or upstream_error.

How do I monitor MCP tool usage and failures?

Route MCP traffic through a governed gateway so each request is logged with the caller, the server, the tool and the result, then track call volume, error rate and latency per tool and per server. Instrumenting every MCP server yourself doesn't scale once agents call many internal and third-party tools. A gateway also sees failures that never reach the server, such as rate limits, policy denials and calls to tools that aren't exposed. On Databricks, Unity Gateway records MCP calls in system tables, a dashboard, audit logs and, in Beta, OpenTelemetry traces.

What MCP monitoring has to capture

The Model Context Protocol (MCP) lets an agent discover tools on a server (tools/list) and call them (tools/call). Useful monitoring answers four questions: which tools get called, by whom, how often they fail, and why. "Why" is the hard one, because MCP failures come from different layers.

Failure type Typical cause Where it shows on Databricks
Upstream error The upstream MCP server failed error.type of upstream_error on trace spans
Protocol error The server returned a JSON-RPC error rpc.response.status_code on trace spans
Policy denial A service policy blocked the call error.type of policy_deny, plus databricks.policy.name
Rate limit Calls exceeded the service's limit HTTP 429
Tool not exposed The tool wasn't selected for the MCP service "Tool not allowed by MCP service configuration."
Internal error The gateway classifies the failure as internal error.type of internal_error

Key capabilities to evaluate

Capability Why it matters
Per-tool call counts Shows which tools agents rely on and which go unused
Caller identity, including agents acting for a user Separates human calls from on-behalf-of agent calls
Status at both the HTTP and JSON-RPC level MCP failures surface in the JSON-RPC response, not only the HTTP status
Tool arguments and results Explains why a call failed, not just that it did
Policy and rate-limit outcomes Distinguishes blocked calls from broken tools
Queryable storage Lets you alert on error rates with SQL

How Databricks approaches MCP monitoring

Unity Gateway governs Databricks-provided MCPs and the external MCP servers you register, each as a Unity Catalog securable (MCPs). Because calls run through the gateway, you get four views without changing the server (Govern an MCP).
Usage table. MCP requests land in system.ai_gateway.usage with service_type = 'MCP_SERVICE' (Track model usage). The mcp_metadata struct holds tool_name (set for tools/call requests), server_type such as EXTERNAL or SYSTEM, and json_rpc_method such as tools/call, tools/list or initialize. Rows also carry requester, status_code and latency_ms. The docs' example counts calls per tool:

SELECT mcp_metadata.tool_name AS tool_name, COUNT(*) AS calls
FROM system.ai_gateway.usage
WHERE service_type = 'MCP_SERVICE'
  AND service_name = 'system.ai.github'
GROUP BY mcp_metadata.tool_name
ORDER BY calls DESC;

Add status_code to the grouping to see which tools fail most.
Dashboard and Metrics tab. The built-in usage dashboard's External MCP Server tab shows request volume, error rates, users and connections, and daily usage trends. Each MCP service also has a Metrics tab in Catalog Explorer (observability).
Audit logs. Each MCP request, such as listing or calling tools, is logged as mcpCall under the mcpService service in system.access.audit. The run_by and run_as fields in identity_metadata tell a human caller apart from an agent acting on their behalf.
Unified trace table (Beta). After a metastore admin sets it up once, MCP spans record mcp.method.name, gen_ai.tool.name, the tool arguments and result, rpc.response.status_code (which the docs call the primary MCP failure signal) and error.type. MCP spans set mlflow.spanType to TOOL for easy filtering (schema reference). It requires the Enhanced Unity Gateway preview (unified trace table).
The same layer lets you act on what you see. Rate limits on MCP services are request-based (QPM) and return HTTP 429 when exceeded. Tool selection hides tools from tools/list. Service policies on MCPs (Beta) can allow, block or require approval for a call before it runs and can check its result.

FAQs

Does MCP monitoring include token counts?

Not for the tool call itself. The usage table records call and service metadata for MCP requests and token metrics for model requests, and token-based rate limits don't apply to MCP services.

How do I tell a broken tool from a blocked one?

Check the error classification in the trace. upstream_error points at the server, while policy_deny means a service policy stopped the call, and the root span names the policy and its action.

Can I see whether an agent or a person made a call?

Yes. In system.access.audit, run_by and run_as in identity_metadata distinguish a human caller from an agent acting for them.

What does an external MCP server need to support?

Streamable HTTP. You register the server in Unity Gateway, and clients call it through the gateway URL, so usage, audit and trace data are collected at the gateway.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.