Skip to main content
Glama

generate_path_map

Read-only

Create visual route maps for travel planning by converting points of interest into detailed maps with locations and photos.

Instructions

Generate a route map to display the user's planned route, such as travel guide routes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe map title should not exceed 16 characters. The content should be consistent with the information the map wants to convey and should be accurate, rich, creative, and attractive.
dataYesRoutes, each group represents all POIs along a route. For example, [{ "data": ["西安钟楼", "西安大唐不夜城", "西安大雁塔"] }, { "data": ["西安曲江池公园", "西安回民街"] }]
widthNoSet the width of map, default is 1600.
heightNoSet the height of map, default is 1000.

Implementation Reference

  • The core handler function for map tools like generate_path_map. It sends the tool name and input parameters to an external visualization server via HTTP POST to generate the path map.
    export async function generateMap(
      tool: string,
      input: unknown,
    ): Promise<ResponseResult> {
      const url = getVisRequestServer();
    
      const response = await axios.post(
        url,
        {
          serviceId: getServiceIdentifier(),
          tool,
          input,
          source: "mcp-server-chart",
        },
        {
          headers: {
            "Content-Type": "application/json",
          },
        },
      );
      const { success, errorMessage, resultObj } = response.data;
    
      if (!success) {
        throw new Error(errorMessage);
      }
      return resultObj;
    }
  • Defines the input schema (using Zod) and tool metadata for the generate_path_map tool, including name, description, and inputSchema.
    const schema = {
      title: MapTitleSchema,
      data: z
        .array(
          z.object({ data: POIsSchema }).describe("The route and places along it."),
        )
        .nonempty("At least one route is required.")
        .describe(
          'Routes, each group represents all POIs along a route. For example, [{ "data": ["西安钟楼", "西安大唐不夜城", "西安大雁塔"] }, { "data": ["西安曲江池公园", "西安回民街"] }]',
        ),
      width: MapWidthSchema,
      height: MapHeightSchema,
    };
    
    // https://modelcontextprotocol.io/specification/2025-03-26/server/tools#listing-tools
    const tool = {
      name: "generate_path_map",
      description:
        "Generate a route map to display the user's planned route, such as travel guide routes.",
      inputSchema: zodToJsonSchema(schema),
      annotations: {
        title: "Generate Path Map",
        readOnlyHint: true,
      },
    };
    
    export const pathMap = {
      schema,
      tool,
    };
  • src/server.ts:64-77 (registration)
    Sets up MCP tool handlers. The listTools handler includes generate_path_map from Charts.pathMap.tool, and callTool requests are routed to the callTool utility.
    function setupToolHandlers(server: Server): void {
      logger.info("setting up tool handlers...");
      server.setRequestHandler(ListToolsRequestSchema, async () => ({
        tools: getEnabledTools().map((chart) => chart.tool),
      }));
    
      // biome-ignore lint/suspicious/noExplicitAny: <explanation>
      server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
        logger.info("calling tool", request.params.name, request.params.arguments);
    
        return await callTool(request.params.name, request.params.arguments);
      });
      logger.info("tool handlers set up");
    }
  • Maps the generate_path_map tool name to the 'path-map' chart type for dispatch.
    const CHART_TYPE_MAP = {
      generate_area_chart: "area",
      generate_bar_chart: "bar",
      generate_boxplot_chart: "boxplot",
      generate_column_chart: "column",
      generate_district_map: "district-map",
      generate_dual_axes_chart: "dual-axes",
      generate_fishbone_diagram: "fishbone-diagram",
      generate_flow_diagram: "flow-diagram",
      generate_funnel_chart: "funnel",
      generate_histogram_chart: "histogram",
      generate_line_chart: "line",
      generate_liquid_chart: "liquid",
      generate_mind_map: "mind-map",
      generate_network_graph: "network-graph",
      generate_organization_chart: "organization-chart",
      generate_path_map: "path-map",
      generate_pie_chart: "pie",
      generate_pin_map: "pin-map",
      generate_radar_chart: "radar",
      generate_sankey_chart: "sankey",
      generate_scatter_chart: "scatter",
      generate_treemap_chart: "treemap",
      generate_venn_chart: "venn",
      generate_violin_chart: "violin",
      generate_waterfall_chart: "waterfall",
      generate_word_cloud_chart: "word-cloud",
    } as const;
  • Identifies generate_path_map as a map chart tool and delegates execution to generateMap.
    const isMapChartTool = [
      "generate_district_map",
      "generate_path_map",
      "generate_pin_map",
    ].includes(tool);
    
    if (isMapChartTool) {
      // For map charts, we use the generateMap function, and return the mcp result.
      const { metadata, ...result } = await generateMap(tool, args);
      return result;
    }
Behavior3/5

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

Annotations declare readOnlyHint=true, indicating a safe read operation. The description adds context about generating a visual map for planned routes, which aligns with the annotation. However, it doesn't disclose additional behavioral traits like whether the map is interactive, how POI data is sourced, or any rate limits. With annotations covering safety, the description adds some value but lacks rich behavioral details.

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, efficient sentence that front-loads the core purpose. It avoids redundancy and waste, though it could be slightly more structured by explicitly mentioning key parameters or output format. Overall, it's appropriately sized for a tool with good schema coverage.

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

Completeness3/5

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

Given the tool's complexity (visual map generation with POI data), lack of output schema, and rich annotations, the description is minimally adequate. It states the purpose but doesn't cover output format (e.g., image file, URL), error handling, or data sourcing details. With annotations providing safety context, it meets basic needs but has clear gaps for effective agent use.

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 parameters thoroughly. The description doesn't add meaning beyond what the schema provides—it doesn't explain parameter interactions or usage nuances. For example, it doesn't clarify how 'title' relates to 'data' or the map output. Baseline 3 is appropriate when the 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 as 'Generate a route map to display the user's planned route, such as travel guide routes.' This specifies the verb ('generate'), resource ('route map'), and context ('planned route'). It distinguishes from siblings by focusing on route visualization rather than charts or other diagrams, though it doesn't explicitly contrast with similar tools like 'generate_pin_map' or 'generate_district_map'.

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. It mentions 'travel guide routes' as an example, but doesn't specify prerequisites, exclusions, or compare it to sibling tools like 'generate_pin_map' for point-based maps or 'generate_district_map' for area-based maps. Usage is implied rather than explicitly defined.

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/antvis/mcp-server-chart'

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