Skip to main content

Module mcp_tools

Module mcp_tools 

Source
Expand description

MCP tool implementations for CodeGraph query and update operations.

Provides 4 CRUD-style tools that agents use instead of file reads/writes:

  • codegraph_query_objects — filter by kind, name, parent, metrics, semantic similarity
  • codegraph_update_object — modify CodeNode fields (signature, docstring, body_hash)
  • codegraph_add_edge — create a relationship between CodeNodes
  • codegraph_remove_edge — logical delete of an edge

These operate directly on Arrow RecordBatches — no file materialization.

Structs§

NodeUpdate
Fields that can be updated on a CodeNode.
QueryFilter
Filter criteria for querying code objects.
QueryResult
Result of a query — matching CodeNodes extracted from RecordBatches.

Enums§

McpToolError
Errors from MCP tool operations.

Functions§

codegraph_add_edge
Add a new edge to the edges batch. Returns a new batch with the edge appended.
codegraph_query_objects
Query code objects from the nodes batch with optional filters.
codegraph_remove_edge
Remove an edge (by setting weight to -1 as a tombstone marker).
codegraph_update_object
Update a CodeNode’s fields in-place. Returns the updated batch.

Type Aliases§

Result