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
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session identifier | |
| method | No | Optional: HTTP method to clear | |
| path | No | Optional: endpoint path to clear |
Implementation Reference
- src/mcp/tools.ts:107-133 (handler)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}` }; } - src/mcp/server.ts:104-115 (registration)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',