Skip to main content
Glama

semantic_search

Read-onlyIdempotent

Find code declarations by name, kind, or language—locate functions, classes, structs, traits, enums, and constants when you already know what they are called.

Instructions

Filter declarations by name, kind or language: functions, methods, classes, structs, traits, enums, types, constants. Call it when you know what the thing is called. It matches names, not meaning. For a description, use semantic_locate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoEntity kind filter (function, class, etc.)
limitNoMax results to return
queryYesName pattern to search for
languageNoLanguage filter (rust, typescript, etc.)
max_charsNoSerialized characters this response may occupy; what was cut is named in `elisions`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.16

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so safety is covered. The description adds the non-obvious behavioral trait that matching is lexical rather than semantic, overriding the misleading tool name — genuinely useful context beyond structured fields, though it says nothing about result shape or truncation behavior.

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?

Three short sentences with zero filler. The capability statement is front-loaded, followed by the routing rule and the counter-example, in exactly the order an agent needs them.

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

Completeness4/5

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

For a read-only, 5-parameter, no-output-schema tool, the description covers purpose and routing adequately, and the schema explains max_chars/elisions behavior. The only gap is that limit/default result volume and the shape of returned declarations are left entirely to the schema.

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%, so baseline is 3. The description goes further by enumerating concrete kind values (functions, methods, classes, structs, traits, enums, types, constants), which expands on the schema's terse 'Entity kind filter (function, class, etc.)' and clarifies the 'query' parameter as a name pattern.

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 gives a specific verb+resource ('Filter declarations by name, kind or language') and enumerates the entity kinds covered. It also preemptively distinguishes itself from the sibling semantic_locate, which matters because the tool's own name ('semantic_search') implies the opposite behavior.

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 states the selecting condition ('Call it when you know what the thing is called'), the exclusion ('It matches names, not meaning'), and names the alternative ('For a description, use semantic_locate'). An agent can route between the two without opening either schema.

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