QuestionQ72

Tool Design & MCP Integration

You are developing developer productivity tools with the Claude Agent SDK. The agent assists engineers in exploring unfamiliar codebases, understanding legacy systems, generating boilerplate code, and automating repetitive tasks. It relies on the built-in tools (Read, Write, Bash, Grep, Glob) and can integrate with Model Context Protocol (MCP) servers.

An engineer asks the agent to locate every file in the monorepo that imports the @company/auth package, in order to understand how authentication is used across services.

Which built-in tool is most suitable for this task?

Explanation

Identifying files that import a specific package requires searching the textual content of files for an import statement pattern (e.g., import ... from '@company/auth' or require('@company/auth')), not just matching file or directory names. The Grep tool is purpose-built for fast, pattern-based content search across many files, making it the appropriate choice for this kind of code-usage discovery task. Glob only matches paths/filenames, Read would require inspecting each file individually without a search mechanism, and Bash's find command only locates files/directories by name rather than inspecting their contents.

Community Discussion

No comments yet. Be the first to start the discussion!