Skip to main content
Glama

cos_doc_search

Read-onlyIdempotent

Search project documentation by combining semantic and lexical matching with metadata filters for domain, layer, and date, so you retrieve current, relevant chunks instead of stale or off-topic ones.

Instructions

Semantic + lexical search over project documentation chunks.

Stage-1 metadata pre-filter (since migration v22): domain, layer, since_iso, and include_inactive narrow the chunk universe BEFORE vector / FTS ranking. Vector search finds meaning; metadata enforces reality (correct era, correct domain, not superseded). Combine with source_types for cheap, indexed pre-filtering.

Args: query: Natural language search query (e.g. "commission rate calculation"). source_types: Optional comma-separated filter — restrict to specific source types (e.g. "prd,architecture,adr"). Empty = all types. limit: Maximum results (1-50, default 5). mode: "auto" (default) | "semantic" | "lexical". domain: Frontmatter domain: filter (BACKEND, FRONTEND, OPS, DOCS, …). Empty = any. Indexed. layer: Frontmatter layer: filter (adr, playbook, spec, policy, reference, runbook, postmortem, task). Empty = any. Indexed. since_iso: Lower bound on frontmatter updated: (YYYY-MM-DD). Use when the agent asks about "recent" or "current" state and a stale older doc would be the wrong answer. Empty = any age. include_inactive: When False (default), hide chunks marked is_active=0 because the source doc was deleted or superseded. Set True for decision-history retrieval that must surface superseded specs. auto_context: When True (default), soft-default domain from the active task's swimlane ($COS_AGENT_DIR/.swimlane). Explicit domain argument always wins. Set False to disable.

Response meta carries filter_hints — heuristic suggestions extracted from the query (date phrasing, domain keywords, layer cues). Suggestions are NEVER auto-applied; the agent decides whether to re-query with them. Mental model: Filter → Search → Summarize. Vector finds meaning, metadata enforces correctness.

Returns: str: JSON envelope with results list and count. Each result carries source_path, source_type, heading_path, content, score, priority, mtime, chunk_index, retrieval_source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoauto
layerNo
limitNo
queryYes
domainNo
since_isoNo
auto_contextNo
source_typesNo
include_inactiveNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description adds significant behavioral context beyond the annotations: it explains the stage-1 metadata pre-filter, how auto_context soft-defaults domain from the active task's swimlane, and that filter_hints are heuristic suggestions never auto-applied. It also discloses the two-stage search process and response meta fields. This goes far beyond the readOnly/idempotent annotations and provides rich behavioral transparency.

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?

Although lengthy, the description is well-structured and every sentence earns its place. It front-loads the core purpose, then systematically explains the pre-filter logic, parameters, and response meta. For a 9-parameter tool with no schema documentation, this level of detail is necessary and appropriately organized with an Args section and clear examples.

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?

The description is complete for the tool's complexity. It covers parameter semantics, behavioral edge cases (e.g., stale docs, superseded specs), response format (JSON envelope with listed fields), and the decision-making flow for filter hints. The presence of an output schema does not negate the need for this semantic richness, and the description delivers it fully.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining each parameter (query, source_types, limit, mode, domain, layer, since_iso, include_inactive, auto_context) with examples, defaults, and behavioral nuances. For instance, it clarifies that 'domain' is 'Indexed' and 'include_inactive' hides chunks marked is_active=0. This is a model of parameter documentation.

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 performs 'Semantic + lexical search over project documentation chunks.' It specifies the resource (project documentation) and distinguishes itself from generic search tools like cos_search by emphasizing metadata pre-filtering and stage-1 filtering. The title 'Search Project Documentation' reinforces the purpose.

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?

The description provides clear context for when to use the tool, including a mental model ('Filter → Search → Summarize') and specific guidance for parameters like since_iso ('Use when the agent asks about recent or current state') and include_inactive ('Set True for decision-history retrieval'). It does not explicitly name alternative tools or exclusions, but the usage context is well implied for a documentation search tool.

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/kouroshez/coding-os'

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