Skip to main content
Glama
parsiya

Trailmark MCP Server

by parsiya

subgraph

Retrieve a list of available subgraph names or query the nodes within a named subgraph for code analysis.

Instructions

Return available subgraph names or the nodes in a named subgraph.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'subgraph' — delegates to TrailmarkRuntime.subgraph(). This is the entry point when the MCP server calls the 'subgraph' tool.
    @mcp.tool()
    def subgraph(name: str | None = None, session_id: str | None = None) -> list[str] | list[dict[str, Any]]:
        """Return available subgraph names or the nodes in a named subgraph."""
        return app_runtime.subgraph(name=name, session_id=session_id)
  • TrailmarkRuntime.subgraph() — the core runtime logic. If name is None, returns available subgraph names via engine.subgraph_names(); otherwise returns the nodes in the named subgraph via engine.subgraph(name).
    def subgraph(
        self,
        name: str | None = None,
        session_id: str | None = None,
    ) -> list[str] | list[dict[str, Any]]:
        engine = self._require_scanned_handle(session_id).engine
        if name is None:
            return engine.subgraph_names()
        return engine.subgraph(name)
  • ToolSpec definition for 'subgraph' — declares the tool name, category ('context'), description, and parameters (name: string|null with default None, session_id: string|null with default None).
    ToolSpec(
        name="subgraph",
        category="context",
        description="Return available subgraph names or the nodes contained in a named subgraph.",
        parameters={"name": _param("string|null", default=None), "session_id": SESSION_ID_PARAM},
    ),
  • Test assertion confirming that 'subgraph' is listed among the available tool names by the MCP server.
    assert "subgraph" in tool_names
  • Serialization of subgraphs to JSON when saving snapshots — uses engine.subgraph(name) to resolve each subgraph name to sorted node IDs.
    "subgraphs": {name: sorted(ids) for name, ids in graph.subgraphs.items()},
Behavior3/5

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

The description discloses the dual behavior (listing names vs. nodes) and implies a read-only operation. However, with no annotations, it does not mention permissions, side effects, or other behavioral traits beyond the basic functionality.

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?

The description is a single sentence with no wasted words, achieving clarity with minimal length.

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

Completeness2/5

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

Given the simplicity of the tool and the presence of an output schema, the description only partially covers the functionality. The lack of parameter explanations and usage context leaves significant gaps, especially with 0% schema description coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description fails to explain the parameters. The 'name' parameter is implied, but 'session_id' is not mentioned at all. This leaves the agent needing to infer parameter usage from the schema alone.

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 clearly states the tool returns either subgraph names or nodes in a named subgraph, with a specific verb and resource. It distinguishes two modes of operation based on the 'name' parameter.

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?

No explicit guidance on when to use this tool versus siblings like 'ancestors_of' or 'search_nodes'. The description implies the context (getting subgraph info) but does not specify alternatives or prerequisites.

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

Install Server

Other Tools

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/parsiya/trailmark-mcp-server'

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