Skip to main content
Glama

search_context

Read-onlyIdempotent

Search team knowledge base for domain rules, conventions, and project notes, returning ranked sections within a token budget to answer queries without exceeding context limits.

Instructions

Search the team's knowledge base (domain rules, conventions, decisions, project notes) and return the most relevant sections, ranked, within a token budget. Use it to look something up or see what exists; use compile_bundle when you want one context block for a task. Read-only. Each section carries its path, heading, scope, score and last-updated date; results never exceed max_tokens and say how many sections the budget omitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsNoRepository-relative code paths you are working on (e.g. ["services/payment/refund.go"]). Documents whose refs cover them are pulled to the top.
queryYesWhat you are working on or looking for, as a natural-language sentence or a few keywords, in any language (e.g. 'retry policy for acquirer calls'). Required, non-empty.
top_kNoMaximum number of sections to return before the token budget applies (default 8, server-capped).
scopesNoKnowledge scopes to search, e.g. ["domain","conventions","projects/ledger-service"]. Default: domain and conventions. Use list_scopes to see the project scopes.
max_tokensNoToken budget for the returned sections (default 2000, must be positive). The result never exceeds it; lower-ranked sections are omitted first.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
budgetYes
chunksYes
scopesYes
omittedYes
total_tokensYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • addedInput schema / properties / paths
      Added value: +{
      +  "description": "Repository-relative code paths you are working on (e.g. [\"services/payment/refund.go\"]). Documents whose refs cover them are pulled to the top.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  2. Changed4 schema fields changedv0.5.0
    • changedInput schema / properties / max_tokens / description
      Previous value: -"Token budget for the returned sections (default 2000). The result never exceeds it."New value: +"Token budget for the returned sections (default 2000, must be positive). The result never exceeds it; lower-ranked sections are omitted first."
    • changedInput schema / properties / query / description
      Previous value: -"What you are working on or looking for, in natural language (e.g. 'retry policy for acquirer calls')"New value: +"What you are working on or looking for, as a natural-language sentence or a few keywords, in any language (e.g. 'retry policy for acquirer calls'). Required, non-empty."
    • changedInput schema / properties / scopes / description
      Previous value: -"Knowledge scopes to search, e.g. [\"domain\",\"conventions\",\"projects/ledger-service\"]. Default: domain and conventions."New value: +"Knowledge scopes to search, e.g. [\"domain\",\"conventions\",\"projects/ledger-service\"]. Default: domain and conventions. Use list_scopes to see the project scopes."
    • changedInput schema / properties / top_k / description
      Previous value: -"Maximum number of sections to return (default 8)"New value: +"Maximum number of sections to return before the token budget applies (default 8, server-capped)."
  3. First observedv0.4.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the description's 'Read-only' aligns with that. It adds valuable behavior beyond annotations: 'results never exceed max_tokens and say how many sections the budget omitted', which informs the agent about output constraints. No contradiction with annotations.

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?

The description is well-structured and front-loaded with the core purpose, then adds usage guidance, read-only note, and output characteristics. Every sentence adds value with no redundancy, and it is appropriately sized for the tool's complexity.

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 the presence of an output schema, the description correctly focuses on when to use the tool and what to expect (e.g., each section's metadata, token budget behavior). It names sibling tools for alternative paths, making it fully self-contained for an agent to decide and invoke 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 description coverage is 100%, so each parameter has a detailed description. The tool description adds minimal extra meaning beyond the schema, such as implying that paths affect ranking, but this is already covered in the path parameter description. With full schema coverage, a baseline of 3 is appropriate.

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 verb 'Search' and the resource 'the team's knowledge base', and specifies the action of returning ranked sections within a token budget. It explicitly distinguishes itself from compile_bundle by naming it as an alternative, making the purpose unambiguous and easily separable from siblings.

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?

It provides explicit when-to-use guidance: 'Use it to look something up or see what exists' and contrasts with compile_bundle for a different need. It also references list_scopes for scopes, giving clear context on how to use the tool and when not to.

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