Skip to main content
Glama
parsiya

Trailmark MCP Server

by parsiya

diff_graphs

Compare two graph snapshots by providing before and after session IDs to get a structured diff highlighting changes.

Instructions

Return a structured diff of the after graph relative to the before graph.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
before_session_idYes
after_session_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for the 'diff_graphs' tool. Retrieves engine handles for before/after session IDs and returns a structured diff including session metadata and engine diff results.
    def diff_graphs(self, before_session_id: str, after_session_id: str) -> dict[str, Any]:
        before_handle = self._require_scanned_handle(before_session_id)
        after_handle = self._require_scanned_handle(after_session_id)
        return {
            "before_session": self._handle_to_dict(before_handle),
            "after_session": self._handle_to_dict(after_handle),
            "diff": after_handle.engine.diff_against(before_handle.engine),
        }
  • MCP tool registration decorator for 'diff_graphs'. Defines the tool function that delegates to app_runtime.diff_graphs().
    @mcp.tool()
    def diff_graphs(before_session_id: str, after_session_id: str) -> dict[str, Any]:
        """Return a structured diff of the after graph relative to the before graph."""
        return app_runtime.diff_graphs(before_session_id=before_session_id, after_session_id=after_session_id)
  • ToolSpec definition for 'diff_graphs' with schema declarations for parameters 'before_session_id' and 'after_session_id' (both required strings) and category 'navigation'.
    ToolSpec(
        name="diff_graphs",
        category="navigation",
        description="Return a structured diff of the after graph relative to the before graph.",
        parameters={
            "before_session_id": _param("string", required=True),
            "after_session_id": _param("string", required=True),
        },
    ),
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits like read-only nature, performance implications, or side effects. The term 'structured diff' is vague and does not clarify the output format or constraints.

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 a single, concise sentence with no redundancy. However, it could be slightly expanded to include critical details without becoming verbose.

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 existence of an output schema, the description is not required to detail return values, but it fails to sufficiently explain what the diff contains (e.g., added/removed nodes, edges). The minimal description leaves agents guessing about the tool's exact behavior.

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

Parameters2/5

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

Schema description coverage is 0%, and the description adds no meaning beyond parameter names. The parameters before_session_id and after_session_id are somewhat self-explanatory, but the description does not explain valid values or how to obtain session IDs.

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 it returns a 'structured diff' of the after graph relative to the before graph, which differentiates it from sibling tools like graph_summary or callers_of. However, it does not explicitly name alternatives or elaborate on what 'structured diff' means.

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 guidance on when to use this tool vs alternatives (e.g., subgraph, paths_between). No prerequisites mentioned, such as ensuring both sessions exist or that the graphs are compatible.

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