Skip to main content
Glama

distance

Calculate the shortest path between two nodes in a system described with EN syntax, identifying subsystem crossings along the route for structural analysis.

Instructions

Shortest path between two nodes with subsystem crossing annotations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesEN source code describing the system
fromYesStarting node name
toYesTarget node name

Implementation Reference

  • The 'distance' tool is registered using 'server.tool', and its handler executes an API call to an external service to calculate the distance.
    server.tool(
      "distance",
      "Shortest path between two nodes with subsystem crossing annotations.",
      {
        source: z.string().describe("EN source code describing the system"),
        from: z.string().describe("Starting node name"),
        to: z.string().describe("Target node name"),
      },
      async ({ source, from, to }) => {
        const result = await callApi("distance", { source, from, to });
        return {
          content: [{ type: "text" as const, text: result.text }],
          isError: result.isError,
        };
      }
    );
Behavior2/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 of behavioral disclosure. While it mentions 'subsystem crossing annotations', it doesn't explain what this means operationally—whether this affects performance, requires specific permissions, has rate limits, or what the output looks like. For a path-finding tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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, efficient sentence that states the core purpose without any fluff. It's appropriately sized and front-loaded, with every word contributing to understanding the tool's function. No wasted words or unnecessary elaboration.

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 complexity of a path-finding tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'subsystem crossing annotations' means, what format the output takes, whether there are performance considerations, or how it differs from sibling tools. For a tool that likely returns structured path data, more context is needed to use it effectively.

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%, so the schema already documents all three parameters (source, from, to) with clear descriptions. The description adds no additional meaning about these parameters beyond what's in the schema. It mentions 'subsystem crossing annotations' which might relate to the 'source' parameter, but this is vague and doesn't enhance parameter understanding. Baseline 3 is appropriate when schema does the heavy lifting.

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's purpose: 'Shortest path between two nodes with subsystem crossing annotations.' It specifies the action (finding shortest path) and the resource (nodes with subsystem annotations). However, it doesn't distinguish this from sibling tools like 'trace' or 'between' that might also involve path-related operations, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'trace', 'between', and 'analyze_system' that might involve similar path or relationship analysis, there's no indication of what makes 'distance' unique or when it's the appropriate choice. The description only states what it does, not when to use it.

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/dushyant30suthar/endiagram-mcp'

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