Skip to main content
Glama

clear_endpoints

Remove configured endpoints from SpyNet's session-based mock servers to manage REST and WebSocket testing environments.

Instructions

Clear configured endpoints (all or specific)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession identifier
methodNoOptional: HTTP method to clear
pathNoOptional: endpoint path to clear

Implementation Reference

  • The implementation of the clear_endpoints tool handler.
    clear_endpoints: async (args: any) => {
      try {
        const { sessionId, method, path } = args;
    
        if (!sessionId) {
          return {
            success: false,
            error: 'Missing required field: sessionId'
          };
        }
    
        const session = sessionManager.getOrCreate(sessionId);
    
        if (method && path) {
          const key = `${method.toUpperCase()}:${path}`;
          session.endpoints.delete(key);
        } else {
          session.endpoints.clear();
        }
    
        return { success: true };
      } catch (error: any) {
        return {
          success: false,
          error: `Failed to clear endpoints: ${error.message}`
        };
      }
  • The registration of the clear_endpoints tool in the MCP server.
    name: 'clear_endpoints',
    description: 'Clear configured endpoints (all or specific)',
    inputSchema: {
      type: 'object',
      properties: {
        sessionId: {
          type: 'string',
          description: 'Session identifier',
        },
        method: {
          type: 'string',
          description: 'Optional: HTTP method to clear',

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