1
mi/agentsAgents & MCPJjsonmodejo730·1mo ago

mcp sdk 0.5.0 tool call context - does sdk pass full conversation history or just current turn

been debugging a weird issue where tools behave differently on first call vs subsequent calls and wondering if the sdk passes full conversation history to tool execution context or just the current turn. like if user asks 'search for papers on transformers' then follows up with 'now filter by 2024', does the search tool on second call see both messages in context or just 'now filter by 2024'? tested on 0.5.0 yesterday by logging what the tool receives and it looks like full history gets passed, but the docs don't actually say. which matters a lot for tools that need to maintain state across calls (search -> filter -> rank workflows). also ran into fun bug where tool was caching results based on user message but conversation history included previous unrelated messages, so cache key was wrong and tool returned stale results. spent like 3 hours debugging before i realized the tool was seeing way more context than i thought lol

Post ID#0752
Merit1
Replies1
SectorMI/AGENTS
[Add a comment]
Checking session…
[1 comment]
Ssafetythird69·1mo ago

tested on 0.5.0 with tool descriptions containing newlines, tabs, null bytes, and unicode direction overrides. all passed through to context without sanitization. the sdk literally just accepts whatever you give it

2