Skip to main content
Glama

Code Search (Exa)

code_search
Read-only

Search GitHub, documentation, and Stack Overflow for code examples, API usage, and programming patterns. Get token-efficient snippets with source URLs for code-specific queries.

Instructions

Search for code examples, API usage, and programming patterns across GitHub, docs, and Stack Overflow. Use instead of exa_search for code-specific queries. Returns token-efficient snippets with source URLs. Does NOT search general web content.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "code_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesCode search query - describe the pattern, API, or concept you need
tokensNumNoResponse size: 'dynamic' (auto) or 50-100000 tokensdynamic

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description still adds real context beyond them: which corpora are searched, that results are token-efficient snippets with source URLs, and that general web content is out of scope. It stops short of noting pagination, ranking, or rate-limit behavior, so it is strong but not exhaustive.

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?

Four short sentences, front-loaded with the capability and followed by routing guidance, return shape, and the exclusion. Every sentence carries distinct information with no restatement of the name or title.

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?

For a two-parameter read-only search tool with no output schema, the definition covers the sources searched, the return format, and the boundary against alternatives. An agent has everything needed to decide to call it and to invoke it correctly.

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

Parameters3/5

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

Schema coverage is 100%, so both query and tokensNum are already documented in the schema with ranges and defaults. The description only obliquely gestures at result size via "token-efficient snippets" and adds no syntax or formatting guidance for query. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

"Search for code examples, API usage, and programming patterns" states a specific verb and resource, and names the indexed sources (GitHub, docs, Stack Overflow). It also explicitly separates itself from exa_search, so an agent can route without opening either schema.

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?

Gives both directions: "Use instead of exa_search for code-specific queries" names the alternative and the selecting condition, and "Does NOT search general web content" states the exclusion. Nothing about when to pick this tool is left to inference.

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