Skip to main content
Glama

knitbrain_search_code

Search codebase for function or class definitions by query, returning ranked snippets with signatures and locations. Use before reading files to reduce context.

Instructions

Retrieval layer (input SELECTION): query → ranked function/class-level chunks (signature + location, NOT whole files) + graph-connected related files, score-gated so no low-relevance context is served. Use BEFORE reading files: search, then knitbrain_read ONLY the hits you need — sending less beats compressing more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoMax hits (default 8).
queryYesWhat you're looking for — names, concepts, error text.
Behavior4/5

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

Describes ranked output, inclusion of related files via graph, and score-gating to filter low-relevance context. For a read-only search tool without annotations, this provides adequate behavioral context without hidden side effects.

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?

Two sentences: first explains what the tool does technically, second gives usage guidance. No redundant words, front-loaded with essential information.

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 no output schema, the description sufficiently describes output format (chunks, signatures, locations, related files). Also covers usage sequence and filtering. Schema covers parameters. No obvious gaps for a search tool.

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

Parameters4/5

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

Schema coverage is 100%, and the description adds meaning to 'query' by specifying examples (names, concepts, error text). For 'k', schema already covers default and max. The description enhances query semantics beyond schema.

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?

The description clearly states the tool returns ranked function/class-level chunks (signature + location, NOT whole files) plus graph-connected related files, score-gated for relevance. It distinguishes from reading whole files, which is a common alternative.

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

Usage Guidelines4/5

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

Explicitly says 'Use BEFORE reading files: search, then knitbrain_read ONLY the hits you need'. Provides clear usage sequence and rationale ('sending less beats compressing more'). Does not compare to other sibling search tools like knitbrain_brain_search.

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/PDgit12/knitbrain'

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