delete_record
Remove a DNS record from the ESA MCP Server by specifying the RecordId, ensuring accurate and secure DNS management. Simplify record deletion tasks with this targeted tool.
Instructions
Deletes a DNS record of a website based on the specified RecordId.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recordId | Yes | The record ID, which can be obtained by calling ListRecords . |
Implementation Reference
- src/tools/site/record.ts:741-750 (handler)The handler function for the delete_record tool. It takes the request, casts arguments to DeleteRecordRequest, calls api.deleteRecord, and returns the JSON stringified response.export const delete_record = async (request: CallToolRequest) => { const req = request.params.arguments as DeleteRecordRequest; const res = await api.deleteRecord(req); return { content: [{ type: 'text', text: JSON.stringify(res) }], success: true, }; };
- src/tools/site/record.ts:520-539 (schema)The tool definition including the input schema for delete_record, specifying the recordId parameter.export const DELETE_RECORD_TOOL: Tool = { name: 'delete_record', description: 'Deletes a DNS record of a website based on the specified RecordId.', inputSchema: { type: 'object', properties: { recordId: { type: 'number', description: 'The record ID, which can be obtained by calling ListRecords .', examples: [1234567890123], }, }, required: ['recordId'], annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, }, }, };
- src/tools/list-esa-function.ts:130-139 (registration)Registration of the delete_record tool (DELETE_RECORD_TOOL) in the ESA_OPENAPI_SITE_LIST array.UPDATE_RECORD_TOOL, CREATE_SITE_MX_RECORD_TOOL, CREATE_SITE_NS_RECORD_TOOL, CREATE_SITE_TXT_RECORD_TOOL, CREATE_SITE_CNAME_RECORD_TOOL, CREATE_SITE_A_OR_AAAA_RECORD_TOOL, DELETE_RECORD_TOOL, LIST_RECORDS_TOOL, GET_RECORD_TOOL, ];
- src/utils/service.ts:433-442 (helper)Helper method in the API service client that wraps the Alibaba Cloud ESA deleteRecord API call.deleteRecord(params: DeleteRecordRequest) { const request = new DeleteRecordRequest(params); return this.callApi( this.client.deleteRecord.bind(this.client) as ApiMethod< DeleteRecordRequest, DeleteRecordResponse >, request, ); }