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
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | EN source code describing the system | |
| from | Yes | Starting node name | |
| to | Yes | Target node name |
Implementation Reference
- src/index.ts:118-133 (handler)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, }; } );