Skip to main content
Glama
Kong

Kong Konnect MCP Server

Official
by Kong

list_services

Retrieve detailed information about all services associated with a specific control plane using the Kong Konnect MCP Server. Input includes control plane ID, pagination size, and optional offset for efficient data retrieval.

Instructions

List all services associated with a control plane.

INPUT:

  • controlPlaneId: String - ID of the control plane

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

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

OUTPUT:

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

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

    • serviceId: String - Unique identifier for the service

    • name: String - Display name of the service

    • host: String - Target host for the service

    • port: Number - Target port for the service

    • protocol: String - Protocol used (http, https, grpc, etc.)

    • path: String - Path prefix for the service

    • retries: Number - Number of retries on failure

    • connectTimeout: Number - Connection timeout in milliseconds

    • writeTimeout: Number - Write timeout in milliseconds

    • readTimeout: Number - Read timeout in milliseconds

    • tags: Array - Tags associated with the service

    • enabled: Boolean - Whether the service 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)
offsetNoOffset token for pagination (from previous response)
sizeNoNumber of services to return

Implementation Reference

  • The primary handler function for the list_services tool. Fetches services via API and transforms the response into a structured format with metadata, services list, and related tools suggestions.
    export async function listServices( api: KongApi, controlPlaneId: string, size = 100, offset?: string ) { try { const result = await api.listServices(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 }, services: result.data.map((service: any) => ({ serviceId: service.id, name: service.name, host: service.host, port: service.port, protocol: service.protocol, path: service.path, retries: service.retries, connectTimeout: service.connect_timeout, writeTimeout: service.write_timeout, readTimeout: service.read_timeout, tags: service.tags, clientCertificate: service.client_certificate, tlsVerify: service.tls_verify, tlsVerifyDepth: service.tls_verify_depth, caCertificates: service.ca_certificates, enabled: service.enabled, metadata: { createdAt: service.created_at, updatedAt: service.updated_at } })), relatedTools: [ "Use list-routes to find routes that point to these services", "Use list-plugins to see plugins configured for these services" ] }; } catch (error) { throw error; } }
  • src/tools.ts:35-41 (registration)
    Tool registration entry defining the method name, name, description (from prompts), input parameters schema, and category.
    { method: "list_services", name: "List Services", description: prompts.listServicesPrompt(), parameters: parameters.listServicesParameters(), category: "configuration" },
  • Zod schema defining input parameters for the list_services tool: controlPlaneId (required), size (default 100), offset (optional).
    export const listServicesParameters = () => 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 services to return"), offset: z.string() .optional() .describe("Offset token for pagination (from previous response)"), });
  • Dispatch handler in the main MCP server switch statement that routes list_services tool calls to the configuration.listServices function.
    case "list_services": result = await configuration.listServices( this.api, args.controlPlaneId, args.size, args.offset ); break;
  • API client method that makes the HTTP request to Kong's list services endpoint.
    async listServices(controlPlaneId: string, size = 100, offset?: string): Promise<any> { let endpoint = `/control-planes/${controlPlaneId}/core-entities/services?size=${size}`; if (offset) { endpoint += `&offset=${offset}`; } return this.kongRequest<any>(endpoint); }

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