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,
        };
      }
    );

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