Skip to main content
Glama
martin-1103
by martin-1103

update_endpoint

Modify existing API endpoint configurations including HTTP methods, URLs, headers, request parameters, and response schemas to maintain accurate API documentation and testing workflows.

Instructions

Update existing endpoint configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpoint_idYesEndpoint ID to update (required)
nameNoUpdated endpoint name (optional)
methodNoUpdated HTTP method (optional)
urlNoUpdated endpoint URL (optional)
descriptionNoUpdated endpoint description (optional)
headersNoUpdated request headers as key-value pairs
bodyNoUpdated request body (JSON string)
purposeNoUpdated business purpose (optional)
request_paramsNoUpdated parameter documentation: {param_name: "description"}
response_schemaNoUpdated response field documentation: {field_name: "description"}
header_docsNoUpdated header documentation: {header_name: "description"}

Implementation Reference

  • Primary handler function that executes the update_endpoint tool: validates input, formats data, calls backendClient.updateEndpoint, handles response and errors.
    export async function handleUpdateEndpoint(args: Record<string, any>): Promise<McpToolResponse> {
      try {
        console.error('[UPDATE-HANDLER] Starting update endpoint with args:', args);
        console.error('[UPDATE-HANDLER] About to get dependencies...');
        const { configManager, backendClient } = await getEndpointDependencies();
        console.error('[UPDATE-HANDLER] Dependencies loaded successfully');
    
        const endpointId = args.endpoint_id as string;
        const name = args.name as string | undefined;
        const method = args.method as HttpMethod | undefined;
        const url = args.url as string | undefined;
        const description = args.description as string | undefined;
        const headers = args.headers as Record<string, string> | undefined;
        const body = args.body as string | undefined;
    
        // Build update data
        const updateData: any = {};
        if (name !== undefined) updateData.name = name.trim();
        if (method !== undefined) updateData.method = method;
        if (url !== undefined) updateData.url = url.trim();
        if (description !== undefined) updateData.description = description.trim() || null;
        if (headers !== undefined) updateData.headers = formatHeaders(headers);
        if (body !== undefined) updateData.body = formatBody(body);
    
        // Validate
        const validationErrors = validateUpdateData({ endpoint_id: endpointId, updateData });
        if (validationErrors.length > 0) {
          throw new Error(validationErrors.join('\n'));
        }
    
        // Update endpoint using BackendClient
        console.error(`[EndpointTools] Updating endpoint: ${endpointId}`);
    
        const result = await backendClient.updateEndpoint(endpointId, updateData);
    
        if (!result.success) {
          throw new Error(`Failed to update endpoint: ${result.error || 'Unknown error'}`);
        }
    
        if (result.data) {
          const updateText = formatEndpointUpdateText(result.data);
    
          return {
            content: [
              {
                type: 'text',
                text: updateText
              }
            ]
          };
        } else {
          return {
            content: [
              {
                type: 'text',
                text: `❌ Failed to update endpoint: No data returned`
              }
            ],
            isError: true
          };
        }
      } catch (error) {
        console.error('[UPDATE-HANDLER] Error caught:', error);
        return {
          content: [
            {
              type: 'text',
              text: `❌ Endpoint update error: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • McpTool definition for 'update_endpoint' including name, description, and detailed inputSchema for parameters.
    export const updateEndpointTool: McpTool = {
      name: 'update_endpoint',
      description: 'Update existing endpoint configuration',
      inputSchema: {
        type: 'object',
        properties: {
          endpoint_id: {
            type: 'string',
            description: 'Endpoint ID to update (required)'
          },
          name: {
            type: 'string',
            description: 'Updated endpoint name (optional)'
          },
          method: {
            type: 'string',
            description: 'Updated HTTP method (optional)',
            enum: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']
          },
          url: {
            type: 'string',
            description: 'Updated endpoint URL (optional)'
          },
          description: {
            type: 'string',
            description: 'Updated endpoint description (optional)'
          },
          headers: {
            type: 'object',
            description: 'Updated request headers as key-value pairs',
            additionalProperties: {
              type: 'string',
              description: 'Header value'
            }
          },
          body: {
            type: 'string',
            description: 'Updated request body (JSON string)'
          },
          purpose: {
            type: 'string',
            description: 'Updated business purpose (optional)'
          },
          request_params: {
            type: 'object',
            description: 'Updated parameter documentation: {param_name: "description"}',
            additionalProperties: {
              type: 'string',
              description: 'Parameter description'
            }
          },
          response_schema: {
            type: 'object',
            description: 'Updated response field documentation: {field_name: "description"}',
            additionalProperties: {
              type: 'string',
              description: 'Response field description'
            }
          },
          header_docs: {
            type: 'object',
            description: 'Updated header documentation: {header_name: "description"}',
            additionalProperties: {
              type: 'string',
              description: 'Header description'
            }
          }
        },
        required: ['endpoint_id']
      }
    };
  • Registers the handler for 'update_endpoint' by mapping updateEndpointTool.name to handleUpdateEndpoint in the tool handlers object.
    export function createEndpointToolHandlers(): Record<string, EndpointToolHandler> {
      return {
        [listEndpointsTool.name]: handleListEndpoints,
        [getEndpointDetailsTool.name]: handleGetEndpointDetails,
        [createEndpointTool.name]: handleCreateEndpoint,
        [updateEndpointTool.name]: handleUpdateEndpoint,
        [deleteEndpointTool.name]: handleDeleteEndpoint
      };
    }
  • Adds updateEndpointTool to the ENDPOINT_TOOLS array, which collects all endpoint management tools for MCP registration.
    export const ENDPOINT_TOOLS: McpTool[] = [
      listEndpointsTool,
      getEndpointDetailsTool,
      createEndpointTool,
      updateEndpointTool,
      deleteEndpointTool
    ];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Update existing endpoint configuration' implies a mutation operation but reveals nothing about permissions required, whether changes are reversible, rate limits, error conditions, or what happens to unspecified fields. For a complex configuration tool with 11 parameters, this is a significant transparency gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action ('update') and target ('existing endpoint configuration'), making it immediately scannable. Every word earns its place in this minimal but complete statement of purpose.

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

Completeness2/5

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

For a complex mutation tool with 11 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't address behavioral aspects like side effects, error handling, or response format. While the schema covers parameter details, the description fails to provide the contextual understanding needed for safe and effective tool invocation.

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?

The input schema has 100% description coverage, providing detailed documentation for all 11 parameters including required/optional status, data types, and enum values. The description adds no parameter information beyond what's already in the schema, so it meets the baseline of 3 where 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 verb 'update' and resource 'existing endpoint configuration', making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'update_environment_variables' or 'update_folder', which also perform updates on different resources. The description is specific about what's being updated but lacks sibling distinction.

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. There's no mention of prerequisites (like needing an existing endpoint), when not to use it, or how it differs from related tools like 'create_endpoint' or 'test_endpoint'. The agent must infer usage from the tool name alone.

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/martin-1103/mcp2'

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