Skip to main content
Glama
amranu

DigitalOcean MCP Server

by amranu

list_endpoints

Explore and filter DigitalOcean API endpoints using tag or limit criteria. Dynamically extract and manage endpoints from OpenAPI specifications for efficient API access.

Instructions

List all available DigitalOcean API endpoints

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoLimit number of results
tagNoFilter by tag (optional)

Implementation Reference

  • The handler function that implements the core logic for the 'list_endpoints' tool. It destructures arguments for tag filter and limit, loads or filters endpoints accordingly, slices to the limit, formats them into a bullet list, and returns a text content response.
    private async handleListEndpoints(args: any) { const { tag, limit = 50 } = args; let endpoints = tag ? getEndpointsByTag(tag) : loadEndpoints(); endpoints = endpoints.slice(0, limit); const endpointList = endpoints.map(ep => `• ${ep.method} ${ep.path} - ${ep.summary} (${ep.operationId})` ).join('\n'); return { content: [ { type: 'text', text: `Found ${endpoints.length} endpoints:\n\n${endpointList}`, }, ], }; }
  • The input schema definition for the 'list_endpoints' tool, specifying optional 'tag' string and 'limit' number parameters.
    inputSchema: { type: 'object', properties: { tag: { type: 'string', description: 'Filter by tag (optional)', }, limit: { type: 'number', description: 'Limit number of results', default: 50, }, }, required: [], },
  • src/index.ts:168-170 (registration)
    The switch case registration in the CallToolRequest handler that routes 'list_endpoints' calls to the handleListEndpoints method.
    case 'list_endpoints': return await this.handleListEndpoints(args);
  • src/index.ts:76-94 (registration)
    The tool object registration in the ListToolsRequest handler, including name, description, and schema.
    { name: 'list_endpoints', description: 'List all available DigitalOcean API endpoints', inputSchema: { type: 'object', properties: { tag: { type: 'string', description: 'Filter by tag (optional)', }, limit: { type: 'number', description: 'Limit number of results', default: 50, }, }, required: [], }, } as Tool,
  • Helper function loadEndpoints() that loads and caches DigitalOcean API endpoints from JSON file, used when no tag filter is provided.
    export function loadEndpoints(): DOEndpoint[] { if (cachedEndpoints) { return cachedEndpoints; } try { const endpointsPath = join(__dirname, '..', 'digitalocean_endpoints.json'); const data = readFileSync(endpointsPath, 'utf-8'); cachedEndpoints = JSON.parse(data) as DOEndpoint[]; return cachedEndpoints; } catch (error) { console.error('Failed to load endpoints:', error); return []; } }

Other Tools

Related 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/amranu/digitalocean-mcp'

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