Skip to main content
Glama

cpg_query

Query the CPG graph with hybrid retrieval: use keywords, natural language questions, or a complete node ID to get ranked nodes, filtered by domain, type, or governance state.

Instructions

Hybrid FTS + embedding retrieval over the CPG graph. Use for structured lookups (node_type/domain filters) or open-ended recall (natural language questions). A complete 32-hex node id is resolved directly. Returns ranked node dicts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNoFilter FACT/BELIEF by domain.
questionYesKeyword or natural language query.
node_typesNoFilter to specific node types.
max_resultsNo
binding_tokenNoOpaque token returned by this agent's join_session or plan_session. Required for reliable identity when logical agents share an MCP connection.
session_scopeNocurrent
governance_statesNoFilter by governance state. Default: confirmed+verified+active.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose that this is a retrieval operation ('over the CPG graph', 'Returns ranked node dicts') and that a complete node ID short-circuits retrieval. It discloses no side effects, but for a read-only query tool this is largely sufficient. Not remarkable, but solid.

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 crisp sentences. Each earns its place: the first establishes the core mechanism, the second covers usage modes, and the third specifies the special-case behavior. No fluff, no repetition.

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 tool with 7 parameters AIDS and no output schema, the description covers the essential usage modes fundamental to correct invocation: what it retrieves over, what kinds of queries it accepts, that filters exist, and what the return shape is. It does not detail ranking semantics or result structure, but the mention of 'ranked node dicts' plus the parameter descriptions is sufficient for an agent to make a reasonable call.

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 71%, with several params described. The description adds real value: 'Hybrid FTS + embedding retrieval' explains what question does, 'node_type/domain filters' maps to node_types/domain params, and 'complete 32-hex node id is resolved directly' clarifies an alternative question behavior. This goes beyond what the schema alone tells an agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific, compound verb phrase: 'Hybrid FTS + embedding retrieval over the CPG graph.' It then enumerates concrete use modes (structured lookups, open-ended recall, direct node-ID resolution). This is far beyond a tautology; however, it does not explicitly contrast with sibling tools like get_nodes, so it stops short of a perfect score.

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 gives explicit guidance on when to use the tool ('Use for structured lookups' or 'open-ended recall') and calls out the special case for complete node IDs. It does not mention exclusions or explicitly route to an alternative, but the actionable use cases are clear enough.

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