You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
After integrating a local MCP server providing code analysis tools (analyze_dependencies, find_dead_code, calculate_complexity), you verify the server is healthy and tools appear in the tools/list response. However, you observe that the agent consistently uses Grep to search for import statements instead of calling analyze_dependencies---even when users explicitly ask about ''code dependencies.'' Examining tool definitions reveals:
MCP analyze_dependencies -- ''Analyzes dependency graph''
Built-in Grep -- ''Search file contents for a pattern using regular expressions. Returns matching lines with line numbers and surrounding context.''
What's the most effective approach to improve the agent's selection of MCP tools?
Claude selects tools principally from their names, descriptions, parameter schemas, and the task context. The current description---''Analyzes dependency graph''---does not explain why the MCP tool is superior to a familiar text search. It omits the tool's scope, the circumstances in which it should be selected, and the structured information it returns.
Anthropic identifies detailed descriptions as the most important factor in tool-use performance. A strong description should state what the tool does, when it should and should not be used, what its parameters mean, and any limitations. Anthropic recommends several sentences for complex tools rather than a short generic label. (https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/implement-tool-use) The MCP connector guidance likewise states that Claude selects among available tools using their names and descriptions and that clear, specific descriptions improve selection accuracy. (https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector)
Option B makes the functional distinction explicit: Grep locates textual import statements, whereas analyze_dependencies constructs a semantic graph containing direct and transitive dependencies, cycles, and potentially unresolved references. Option A is a brittle global override. Option C removes a generally useful tool. Option D increases the number of tools and selection ambiguity, contrary to Anthropic's recommendation to consolidate related operations where practical.
Official references/topics: MCP Tool Discovery; Tool Descriptions; Tool Selection Accuracy; Tool-Surface Design.
Your pipeline reviews every pull request using a single API call with a static prompt containing the diff and the full text of each changed file; unchanged files are not included. Reviews are posted asynchronously and do not block pull-request creation. Developers report that reviews consistently miss bugs involving cross-file interactions---for example, a pull request renames a function's parameters, but the review does not flag callers in other files that still use the old parameter names. Post-release analysis shows that cross-file bugs account for 35% of production incidents from reviewed pull requests. What is the most effective change to your review design?
The failure is caused by missing evidence, not insufficient reasoning over the supplied evidence. A static prompt containing only changed files cannot reliably identify callers, configuration dependencies, generated interfaces, or indirect relationships located elsewhere in the repository. Asking Claude to reason more deeply cannot recover code that it was never given.
Option A converts the review into a bounded agentic loop. Claude can search for symbol references, read relevant callers, inspect type definitions, and follow newly discovered dependencies before validating a potential defect. Anthropic describes the Claude Code agentic loop as gathering context, taking action, verifying results, and repeating based on tool feedback. A turn limit preserves predictable cost and execution time.
Option C improves coverage but imposes an arbitrary two-hop boundary and depends on the accuracy of a precomputed graph, which may omit dynamic imports, reflection, generated code, configuration references, or language-specific call relationships. Option D creates duplicated context and aggregation complexity while still limiting each reviewer to predetermined dependents. Option B changes the reasoning instructions but supplies no mechanism for checking unchanged files. Tool-enabled, just-in-time retrieval is therefore the most adaptable and reliable architecture for cross-file review.
================
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
Your agent has spent 25 minutes exploring a game engine's rendering subsystem---reading shader code, buffer management, and frame synchronization logic. An engineer now asks it to understand how the physics engine integrates with rendering for collision debug overlays. You notice recent responses reference ''typical rendering patterns'' rather than the specific VulkanPipeline and FrameGraph classes it discovered earlier.
What's the most effective approach?
The reference to generic rendering patterns indicates that the current context has become saturated or that important earlier details are no longer receiving sufficient attention. Anthropic documents that performance can degrade as a Claude Code context window fills with conversation history, file contents, and command output; symptoms include forgetting earlier instructions and making less precise responses. (https://code.claude.com/docs/en/best-practices)
Option C preserves the high-value rendering discoveries while isolating the physics investigation. The summary should identify the relevant rendering classes, synchronization boundaries, debug-overlay interfaces, and unresolved integration questions. A physics-focused subagent can then inspect collision and simulation code in its own context without adding dozens of additional files to the already crowded main conversation.
This explicit summary matters because an ordinary named subagent starts with a fresh, isolated context and does not automatically receive the parent's full conversation history or previously read files. Claude constructs a delegation message containing the task context, so the essential rendering findings must be supplied deliberately. (https://docs.anthropic.com/en/docs/claude-code/sub-agents)
Option A omits the integration context needed to guide the physics search. Option B destroys useful prior analysis. Option D keeps expanding an already degraded context and treats the symptom rather than controlling context growth.
Official references/topics: Context-Window Management; Subagent Isolation; Delegation Summaries; Codebase Exploration.
You are building developer-productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools---Read, Write, Bash, Grep, and Glob---and integrates with Model Context Protocol (MCP) servers.
After adding an MCP server with specialized code-refactoring tools---extract_function, rename_variable, and inline_function---you notice that the agent still uses basic text manipulation through Write and Bash sed commands for refactoring tasks. The MCP server is connected and healthy. Examining the configuration, you find that each MCP tool has a minimal description such as, ''extract_function: Extracts a function from code.''
What is the most effective way to improve adoption of the MCP refactoring tools?
Option C corrects the weak selection signal presented to the model. Claude chooses among available tools using their names, descriptions, parameter schemas, and the current request. ''Extracts a function from code'' does not explain whether the tool understands syntax trees, preserves imports, updates call sites, validates scope, or offers advantages over Write and sed. Anthropic identifies prompt-engineering tool descriptions as one of the most effective ways to improve agent tool use. Descriptions should state what the operation performs, when it should be selected, what inputs are required, what output it returns, and any limitations.
Option A adds a separate probabilistic routing layer without improving the tool contract Claude ultimately sees. Option B ignores the server's intended value. Option D removes a broadly useful capability and may prevent unrelated edits without guaranteeing that the MCP tools are used correctly. Each refactoring tool should instead describe its semantic behavior and contrast it with plain text manipulation---for example, that rename_variable performs scope-aware symbol renaming and updates references. Clear schemas, concrete examples, and evaluation against real refactoring tasks should accompany the improved descriptions.
================
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
A user expands the research system beyond its original web-search agent by adding specialized data sources. A financial API agent returns structured JSON containing revenue, margins, and growth rates. A news-monitoring agent returns prose summaries of recent developments. A patent-analysis agent returns structured lists of technology areas. The synthesis agent combines these results into executive briefings. Currently, it converts everything into bullet points, causing financial comparisons to lose tabular clarity and news summaries to lose their narrative flow.
What change would most improve briefing quality?
Option C preserves the information structure that makes each source useful. Financial metrics share comparable fields and therefore benefit from rows, columns, aligned units, and reporting periods. News findings require connected prose to preserve chronology and causal relationships, while patent technology areas are naturally represented as categorized lists. Anthropic's output-consistency guidance recommends specifying the exact output format needed for the task rather than relying on an unspecified default. Anthropic's discussion of its multi-agent research system also recognizes specialized output stages for reports, structured data, and visualizations because specialist prompts can produce better results than generic coordinator processing. Option A destroys the comparative structure of numerical data. Option D can provide a useful provenance contract internally but does not determine how the executive briefing should present heterogeneous content. Option B risks creating a lowest-common-denominator representation that discards source-specific advantages. The synthesis contract should preserve normalized facts and provenance internally while directing the report generator to select presentation forms according to the content's semantic structure and the executive reader's needs.
================
Currently there are no comments in this discussion, be the first to comment!