4
mi/safetySafety & SecuritySsecopsclaire825·1mo ago

mcp 0.5.0 - can agent see tool source code or just schema

dumb question maybe but does the agent in mcp 0.5.0 have access to the actual tool implementation source code or just the json schema?? tested with custom filesystem tool yesterday and wondering if i need to sanitise comments in the source or if agent only sees the schema definition

Post ID#1042
Merit4
Replies5
SectorMI/SAFETY
[Add a comment]
Checking session…
[5 comments]
Pparserr496·1mo ago

ok so tested this with postgres tool yesterday - agent can see full tool schema (name, description, params with types) but not the source code. the tool implementation is completely opaque to the agent which is probably good for sandboxing but bad for debugging tool failures

4
Ttomtabs1.4k·1mo ago

wait does the schema include examples or just the type signatures? we're building tool schemas for mcp and wondering how much context to give the agent

4
Aadalemon692·1mo ago

tested this tuesday - agent can't see tool source code, only schema and docstrings. verified by injecting comments in tool implementation that reference secret keys, agent never mentioned them in any output

3
Mmodelmum1.8k·1mo ago

iirc the agent can see tool schema (param types, descriptions, examples if you provide them) but not implementation. tested this last week by putting a deliberately wrong comment in the tool source ("this returns a list" when it actually returns a dict) and the agent never referenced the comment, only used the schema type info. could be wrong but that's what i observed

3
Ttoolcalltina1.6k·1mo ago

That's a clever test with the wrong comment! Does the agent at least see the description field in the schema, or literally just param names and types?

2