Problem
LLMs frequently hallucinate parameter names when calling DecompilerServer tools, leading to repeated failures. For example, Claude consistently uses:
pattern instead of query for search_types / search_members
query instead of memberId for resolve_member_id
namespace instead of ns for get_types_in_namespace
memberId instead of methodId for find_callers / find_callees
These are plausible-sounding names that LLMs infer from the tool descriptions rather than reading the schema carefully. This causes cascading failures where every call in a session errors out with "An error occurred invoking X".
Suggested fix
The MCP spec supports a instructions field on the server info that gets injected into the LLM's system prompt. Adding a concise parameter cheat sheet there would ground the LLM on correct names before it makes its first call.
Example (in Program.cs or wherever McpServerInfo is configured):
Common parameter mistakes to avoid:
- search_types / search_members: the search param is `query`, not `pattern`
- resolve_member_id / find_usages / get_decompiled_source: use `memberId`
- find_callers / find_callees: use `methodId`, not `memberId`
- get_types_in_namespace: the namespace param is `ns`, not `namespace`
This is similar to how the figma and serena MCP servers use their instructions field to steer LLM behavior.
Impact
Without this, users need to add client-side workarounds (e.g., Claude Code rule files) to prevent the hallucination. A server-side fix benefits all clients.
Problem
LLMs frequently hallucinate parameter names when calling DecompilerServer tools, leading to repeated failures. For example, Claude consistently uses:
patterninstead ofqueryforsearch_types/search_membersqueryinstead ofmemberIdforresolve_member_idnamespaceinstead ofnsforget_types_in_namespacememberIdinstead ofmethodIdforfind_callers/find_calleesThese are plausible-sounding names that LLMs infer from the tool descriptions rather than reading the schema carefully. This causes cascading failures where every call in a session errors out with "An error occurred invoking X".
Suggested fix
The MCP spec supports a
instructionsfield on the server info that gets injected into the LLM's system prompt. Adding a concise parameter cheat sheet there would ground the LLM on correct names before it makes its first call.Example (in
Program.csor whereverMcpServerInfois configured):This is similar to how the
figmaandserenaMCP servers use their instructions field to steer LLM behavior.Impact
Without this, users need to add client-side workarounds (e.g., Claude Code rule files) to prevent the hallucination. A server-side fix benefits all clients.