update_server_response
Update a mock server response's name, HTTP status code, headers, body, active status, or delay. Provide the mock server ID and response ID.
Instructions
Update a server response
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mockId | Yes | The mock server ID | |
| serverResponseId | Yes | The server response ID | |
| serverResponse | Yes |
Implementation Reference
- src/tools/api/mocks/index.ts:206-212 (handler)Handler function that executes the update_server_response tool logic. Makes a PUT request to update a server response on a mock server.
async updateServerResponse(args: any): Promise<ToolCallResponse> { const response = await this.client.put( `/mocks/${args.mockId}/server-responses/${args.serverResponseId}`, { serverResponse: args.serverResponse } ); return this.createResponse(response.data); } - src/tools/api/mocks/index.ts:54-55 (registration)Routes the 'update_server_response' tool call to the updateServerResponse handler in the switch statement.
case 'update_server_response': return await this.updateServerResponse(args); - Schema definition for the update_server_response tool, including its input parameters and types.
{ name: 'update_server_response', description: 'Update a server response', inputSchema: { type: 'object', required: ['mockId', 'serverResponseId', 'serverResponse'], properties: { mockId: { type: 'string', description: 'The mock server ID' }, serverResponseId: { type: 'string', description: 'The server response ID' }, serverResponse: { type: 'object', properties: { name: { type: 'string', description: 'Updated response name' }, code: { type: 'number', description: 'Updated HTTP status code' }, headers: { type: 'array', description: 'Updated response headers', items: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' } } } }, body: { type: 'string', description: 'Updated response body' }, active: { type: 'boolean', description: 'Change active status' }, delay: { type: 'number', description: 'Updated response delay' } } } } } },