Skip to main content
Glama

find_chunks_for_files

Read-only

Locate chunks in a diff file that match a file pattern, such as '*.py', to focus analysis on specific changes without loading the entire diff.

Instructions

Locate chunks containing files that match a specific glob pattern. Auto-loads the diff file if not already loaded. Essential for targeted analysis when you need to focus on specific file types, directories, or naming patterns (e.g., '.py' for Python files, 'test' for test files, 'src/' for source directory). Returns chunk numbers which you then examine using get_chunk. CRITICAL: You must use an absolute directory path - relative paths will fail. DO NOT attempt direct file reading. Use this for efficient navigation to relevant changes instead of processing entire large diffs sequentially.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesGlob pattern to match file paths (e.g., '*.py', '*test*', 'src/*')
absolute_file_pathYesAbsolute path to the diff file
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond readOnlyHint=true annotation, description reveals auto-loading behavior and that output is chunk numbers. Warns about relative path failure. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

5 sentences, front-loaded with purpose, each sentence adds unique value (purpose, auto-load, use case, examples, critical warnings). No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 required parameters and no output schema, description covers all essential aspects: purpose, behavior, constraints, and next step (use get_chunk). Siblings listed for context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% parameters, but description adds valuable context: pattern examples ('*.py'), and reiterates absolute path requirement with rationale.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb+resource: 'Locate chunks containing files' with specific glob pattern. Distinguishes from siblings like get_chunk and list_chunks by focusing on file-pattern based searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use (targeted analysis instead of processing entire diffs), critical constraints (absolute path required, no direct file reading), and alternatives relative to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/peteretelej/diffchunk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server