CostAffective
Back to Tools Overview
search_code tool

Tool: search_code

Executes static AST fuzzy searches matching semantic keywords or variable names across indexed codebase files.

Arguments Schema

ParameterTypeRequiredDescription
querystringRequiredFuzzy search pattern or functional keyword.
budgetstringOptionalToken boundary limit (small: 500, medium: 1500, large: 3000).
Tool Input JSONRequest
{
  "query": "NewServer",
  "budget": "small"
}
Tool Response JSONResponse
[
  {
    "file": "internal/mcpserver/server.go",
    "line": 42,
    "content": "func NewServer(addr string) *Server {",
    "context": "AST scope: func NewServer (lines 42-60)"
  }
]

Developer Best Practices

  • Supply a token budget to prevent AI prompt overflow on wide matches.
  • Use exact function names where possible to trigger direct SQLite lookups.