Skip to main content
Glama

query_graph

Run read-only SQL queries on the symbol graph to inspect symbols, relationships, and indexed files.

Instructions

Execute a custom SQL query on the symbol graph (read-only)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "query_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesSQL query (SELECT only). Tables: symbols, edges, indexed_files
projectNoProject name to filterdefault

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden; it does disclose the key safety trait ('read-only'), which is the main risk signal for a raw-SQL tool. However, it says nothing about SQL dialect, row limits, timeouts, cost of complex queries, or what happens on invalid SQL, which matter a great deal for arbitrary query execution.

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?

A single short sentence with the essential information front-loaded and no wasted words. Its brevity is well suited to a short tool blurb, though it borders on under-specification for a raw-SQL interface.

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

Completeness3/5

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

The tool is simple (two parameters, no output schema, no nested objects) and the schema covers the parameter surface well, so the definition is workable. For an arbitrary-SQL tool, though, the absence of dialect, limit, and result-shape guidance leaves notable gaps that the description could have closed.

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%, and the schema itself documents the query string, the available tables (symbols, edges, indexed_files), and the project filter. The description adds no meaning beyond that, so the baseline of 3 for fully documented parameters applies.

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 names a specific verb and resource: executing a custom SQL query against a 'symbol graph'. This is clearly distinct from sibling retrieval tools like search_symbols or get_symbol_info. It stops short of naming an alternative or stating when the escape hatch is preferred over those siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use guidance, no exclusions beyond the parenthetical '(read-only)', and no steering toward simpler sibling tools for common queries. The agent must infer that this is a power-user escape hatch rather than the default way to look up symbols.

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