Skip to main content
Glama

codegraph_query

Execute raw Cypher queries to analyze dependencies, imports, and modifications across projects, files, symbols, and sessions.

Instructions

Execute a raw Cypher query against the code intelligence graph.

The graph contains: Project, File, Symbol, Package, Session nodes. Edges: HAS_FILE, DEFINES, DEPENDS_ON, MODIFIED, IN_PROJECT, TOUCHED, EDITED, CREATED, IMPORTS (File->File or File->Package), CALLS (File->Symbol), INHERITS (Symbol->Symbol).

Example queries:

  • MATCH (p:Project) RETURN p.name, p.path LIMIT 10

  • MATCH (f:File {project: 'my-app'}) RETURN f.path, f.lang LIMIT 20

  • MATCH (p:Project)-[:DEPENDS_ON]->(pkg:Package) WHERE pkg.name = 'react' RETURN p.name

  • MATCH (s:Session)-[:EDITED]->(f:File) RETURN f.path, COUNT(s) ORDER BY COUNT(s) DESC LIMIT 10

Args: query: Cypher query string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.6.0

TDQS

A4/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 burden. It explains the tool's data model and provides example queries, which sets expectations about the graph structure. However, it does not disclose whether queries are read-only, performance implications, potential for heavy load, or error behavior on malformed queries. For a raw-query tool, this is a notable gap.

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 well-structured: a single sentence opens with the core function, then a structured list of graph components, followed by examples. It is slightly long but each element earns its place, especially the examples which are essential for an action with a single free-form parameter. Dense but not bloated.

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?

The description covers the graph schema, edge types, and parameter semantics, and there is an output schema present (not shown) that may convey return structure. What is missing is guidance on performance, query limits, or security considerations. For a power-user tool, this is adequate but not fully comprehensive.

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?

The schema only defines 'query' as a string with 0% description coverage. The description compensates fully by specifying that it is a Cypher query string, describing the available entities and edges, and offering multiple concrete examples that illustrate valid query syntax. This adds significant meaning beyond the bare schema.

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 executes a raw Cypher query against a code intelligence graph, specifying node types and edge types. This provides a precise verb and resource, and visually distinguishes it from siblings like source_search or kb_search, which are likely semantic. The examples solidify the intended scope.

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

Usage Guidelines3/5

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

The description conveys that this is for raw Cypher queries, which implies flexibility for complex or custom analyses. However, it does not explicitly state when to prefer this over sibling tools like codegraph_stats or source_search, nor does it mention any exclusions or recommended fallbacks. The usage context is clear but not contrastive.

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

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/fortunto2/solograph'

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