Skip to main content
Glama

configure_endpoint

Set up mock API endpoints with sequential responses for testing and development. Define HTTP methods, paths, and response sequences to simulate real API behavior.

Instructions

Configure a mock API endpoint with sequential responses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession identifier
methodYesHTTP method (GET, POST, etc.)
pathYesEndpoint path (e.g., /api/users)
responsesYesArray of responses for sequential behavior

Implementation Reference

  • The handler implementation for the configure_endpoint tool. It validates the input arguments, retrieves or creates a session using the sessionManager, and updates the endpoints map for that session.
    configure_endpoint: async (args: any) => {
      try {
        const { sessionId, method, path, responses } = args;
    
        if (!sessionId || !method || !path) {
          return {
            success: false,
            error: 'Missing required fields: sessionId, method, path'
          };
        }
    
        if (!responses || !Array.isArray(responses) || responses.length === 0) {
          return {
            success: false,
            error: 'Must provide at least one response'
          };
        }
    
        const session = sessionManager.getOrCreate(sessionId);
        const key = `${method.toUpperCase()}:${path}`;
    
        session.endpoints.set(key, {
          method,
          path,
          responses,
          callCount: 0
        });
    
        return { success: true };
      } catch (error: any) {
        return {
          success: false,
          error: `Failed to configure endpoint: ${error.message}`
        };
      }
    },
  • The tool registration block for configure_endpoint, including the schema definition.
    {
      name: 'configure_endpoint',
      description: 'Configure a mock API endpoint with sequential responses',
      inputSchema: {
        type: 'object',
        properties: {
          sessionId: {
            type: 'string',
            description: 'Session identifier',
          },
          method: {
            type: 'string',
            description: 'HTTP method (GET, POST, etc.)',
          },
          path: {
            type: 'string',
            description: 'Endpoint path (e.g., /api/users)',
          },
          responses: {
            type: 'array',
            description: 'Array of responses for sequential behavior',
            items: {
              type: 'object',
              properties: {
                status: { type: 'number' },
                headers: { type: 'object' },
                body: {},
              },
              required: ['status'],
            },
          },
        },
        required: ['sessionId', 'method', 'path', 'responses'],
      },
    },
Behavior3/5

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

Discloses 'sequential responses' behavior not inferable from just 'endpoint', but lacks critical operational context given zero annotations: idempotency (create vs update), side effects, return values, error conditions, or session lifecycle requirements.

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?

Single 7-word sentence is maximally front-loaded with no waste. However, for a 4-parameter configuration tool with complex sequential behavior, slightly undersized - could benefit from one additional sentence on behavioral context without hurting conciseness.

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?

Adequate basic coverage given rich schema (100%), but incomplete for a mutation tool with no annotations or output schema. Missing: return value description, error scenarios, idempotency guarantees, and relationship to session lifecycle that would help an agent use this correctly in the mock server workflow.

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 has 100% description coverage, establishing baseline 3. Description mentions 'sequential responses' which aligns with but essentially restates the schema's 'Array of responses for sequential behavior' on the responses parameter. No additional semantic value added for sessionId, method, or path beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear specific verb ('Configure') + resource ('mock API endpoint') + distinguishing trait ('sequential responses'). The sequential responses detail clearly differentiates this from sibling read/delete tools like list_endpoints or clear_endpoints.

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?

No guidance on when to use versus alternatives, prerequisites (e.g., requiring an existing session), or workflow ordering relative to siblings like list_sessions or clear_endpoints. Only states what it does, not when to do it.

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/aj-bartocci/SpyNet'

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