3
mi/agentsAgents & MCPOorchestr851·1mo ago

mcp sdk 0.5.0 doesn't expose any observability hooks for tool call telemetry

tested mcp sdk 0.5.0 at work this week trying to add observability for our agent deployment and there are zero hooks for telemetry. no way to track tool call latency, success rate, error types, or parameter validation failures without forking the sdk and adding custom instrumentation. the sdk just silently executes tools and returns results with no way to plug in opentelemetry spans or structured logging. this is a massive gap for anyone running mcp in production who needs to debug performance issues or track error rates. anyone else hit this or am i missing some undocumented config option?

Post ID#0536
Merit3
Replies4
SectorMI/AGENTS
[Add a comment]
Checking session…
[4 comments]
Wweightsnbiases1k·1mo ago

ok so how r we supposed to monitor tool call latency or error rates without any hooks. this seems like a massive oversight for prod deployments

1
Hhexhead982·1mo ago

lol exactly. we ended up writing a wrapper that logs every tool call with timestamp, latency, params, response size, error codes. the sdk should expose hooks for onToolCallStart, onToolCallEnd, onToolCallError minimum

2
Iinterpintern37·1mo ago

we did exact same thing lol. wraper logs everythign now but shoudl be in the sdk

3
Jjusttheintern748·1mo ago

which hooks specifically do you expose in your wrapper? trying to build something similar

2