Skip to main content
Glama
Kong

Kong Konnect MCP Server

Official
by Kong

list_routes

Retrieve and display all configured routes for a specific Kong Konnect control plane, including protocol, method, host, and path details for traffic management.

Instructions

List all routes associated with a control plane.

INPUT:

  • controlPlaneId: String - ID of the control plane

  • size: Number - Number of routes to return (1-1000, default: 100)

  • offset: String (optional) - Pagination offset token from previous response

OUTPUT:

  • metadata: Object - Contains controlPlaneId, size, offset, nextOffset, totalCount

  • routes: Array - List of routes with details for each including:

    • routeId: String - Unique identifier for the route

    • name: String - Display name of the route

    • protocols: Array - Protocols this route accepts (http, https, grpc, etc.)

    • methods: Array - HTTP methods this route accepts

    • hosts: Array - Hostnames this route matches

    • paths: Array - URL paths this route matches

    • stripPath: Boolean - Whether to strip the matched path prefix

    • preserveHost: Boolean - Whether to preserve the host header

    • serviceId: String - ID of the service this route forwards to

    • enabled: Boolean - Whether the route is enabled

    • metadata: Object - Creation and update timestamps

  • relatedTools: Array - List of related tools for further analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
controlPlaneIdYesControl Plane ID (obtainable from list-control-planes tool)
sizeNoNumber of routes to return
offsetNoOffset token for pagination (from previous response)

Implementation Reference

  • The handler function that executes the list_routes tool logic: fetches routes from the Kong API and transforms the response into a standardized format.
    export async function listRoutes(
      api: KongApi,
      controlPlaneId: string,
      size = 100,
      offset?: string
    ) {
      try {
        const result = await api.listRoutes(controlPlaneId, size, offset);
    
        // Transform the response to have consistent field names
        return {
          metadata: {
            controlPlaneId: controlPlaneId,
            size: size,
            offset: offset || null,
            nextOffset: result.offset,
            totalCount: result.total
          },
          routes: result.data.map((route: any) => ({
            routeId: route.id,
            name: route.name,
            protocols: route.protocols,
            methods: route.methods,
            hosts: route.hosts,
            paths: route.paths,
            https_redirect_status_code: route.https_redirect_status_code,
            regex_priority: route.regex_priority,
            stripPath: route.strip_path,
            preserveHost: route.preserve_host,
            requestBuffering: route.request_buffering,
            responseBuffering: route.response_buffering,
            tags: route.tags,
            serviceId: route.service?.id,
            enabled: route.enabled,
            metadata: {
              createdAt: route.created_at,
              updatedAt: route.updated_at
            }
          })),
          relatedTools: [
            "Use query-api-requests with specific routeIds to analyze traffic",
            "Use list-services to find details about the services these routes connect to",
            "Use list-plugins to see plugins configured for these routes"
          ]
        };
      } catch (error) {
        throw error;
      }
    }
  • Zod schema defining input parameters for the list_routes tool: controlPlaneId (required), size (optional, default 100), offset (optional).
    export const listRoutesParameters = () => z.object({
      controlPlaneId: z.string()
        .describe("Control Plane ID (obtainable from list-control-planes tool)"),
      size: z.number().int()
        .min(1).max(1000)
        .default(100)
        .describe("Number of routes to return"),
      offset: z.string()
        .optional()
        .describe("Offset token for pagination (from previous response)"),
    });
  • src/tools.ts:42-48 (registration)
    Registration of the list_routes tool in the tools array, specifying method, name, description, parameters schema, and category.
    {
      method: "list_routes",
      name: "List Routes",
      description: prompts.listRoutesPrompt(),
      parameters: parameters.listRoutesParameters(),
      category: "configuration"
    },
  • src/index.ts:83-89 (registration)
    Dispatch handler in the MCP server that routes list_routes calls to the configuration.listRoutes function.
    case "list_routes":
      result = await configuration.listRoutes(
        this.api,
        args.controlPlaneId,
        args.size,
        args.offset
      );
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: pagination support (via 'offset'), default values ('size' defaults to 100), and output structure details. However, it lacks information on rate limits, authentication needs, error handling, or whether this is a read-only operation (implied but not stated).

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 well-structured with clear sections (INPUT, OUTPUT) and uses bullet points for readability. It's appropriately sized for the tool's complexity, though the OUTPUT section is quite detailed and might benefit from more front-loading of key information.

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

Completeness4/5

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

Given the tool's moderate complexity (3 parameters, paginated list operation) and lack of annotations/output schema, the description does a good job of covering essential aspects: purpose, parameters, and detailed output format. It compensates for missing structured fields by explicitly documenting the return structure, though it could improve by adding usage context.

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 adds minimal value beyond the schema, briefly mentioning the parameters in the INPUT section but not providing additional context, constraints, or examples. Baseline 3 is appropriate given high schema coverage.

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 verb ('List') and resource ('routes associated with a control plane'), making the purpose specific and understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'list_control_planes' or 'list_services', which might have similar listing functionality but for different resources.

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 doesn't mention prerequisites (e.g., needing a control plane ID from 'list_control_planes'), exclusions, or comparisons to sibling tools, leaving the agent to infer usage context.

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/Kong/mcp-konnect'

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