Skip to main content
Glama

Persistent Project Context for xAI Grok

Search a Grok Collection (edge, KV-cached)

faf_collections_search
Read-onlyIdempotent

Phase III (FRC §7b) — semantic search over a Grok Collection at the edge, KV-cached (1h TTL). Returns matched chunks (content, score, file). Requires the XAI_API_KEY secret; composes with faf_section (structural) for hybrid retrieval. Handled env-aware in the MCP handler (needs the key + KV).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax chunks to return (default 5).
queryYesThe search query.
collection_idYesThe Grok Collection id to search.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "content": {
      -      "items": {
      -        "properties": {
      -          "text": {
      -            "description": "Matched collection chunks with scores and cache status.",
      -            "type": "string"
      -          },
      -          "type": {
      -            "const": "text",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "type",
      -          "text"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "isError": {
      -      "type": "boolean"
      -    }
      -  },
      -  "required": [
      -    "content",
      -    "isError"
      -  ],
      -  "type": "object"
      -}New value: +null
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "content": {
      +      "items": {
      +        "properties": {
      +          "text": {
      +            "description": "Matched collection chunks with scores and cache status.",
      +            "type": "string"
      +          },
      +          "type": {
      +            "const": "text",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type",
      +          "text"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "isError": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "content",
      +    "isError"
      +  ],
      +  "type": "object"
      +}
  3. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate read-only, idempotent, open-world, and non-destructive. The description adds valuable operational behavior: 1-hour KV caching, edge execution, requirement for the XAI_API_KEY secret, env-aware handling, and the chunk return shape. It does not mention what happens if the secret or KV store is unavailable, but this is minor given the annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core operation. The factional reference 'Phase III (FRC §7b)' is mildly noisier for a general AI agent but doesn't hurt overall. No redundant padding.

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 search tool with only three parameters and no output schema, the description covers the needed selection, return, and operational context: what it searches, how it returns results, how it composes with faf_section, and what secrets/KV resources are required. The absence of an output schema is compensated by the explicit 'content, score, file' summary.

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 the baseline is 3. The description exceeds the baseline by clarifying that 'query' is semantic, not lexical, and that results take the form of matched chunks with content, score, and file. This adds meaning beyond the schema's simple field labels.

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 states a precise operation: 'semantic search over a Grok Collection', identifies the resource, and indicates it returns matched chunks. It also differentiates itself from the structural sibling faf_section and adds scoping ('edge', 'KV-cached'), so an agent can distinguish it from the many sibling tools.

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?

It gives clear context: this is the semantic querying tool, and it can be composed with faf_section for hybrid retrieval. It does not explicitly provide 'when-not-to-use' exclusions, but the semantic/structural distinction gives enough guidance for selection among siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.