delete_record
Remove records from enterprise systems by specifying record type and ID. This tool deletes customer, invoice, or other data from upstream APIs like Salesforce or NetSuite.
Instructions
Delete a record from the upstream API.
Args: record_type: The type of record (e.g., "customer", "invoice") record_id: Internal ID of the record. account_id: Account ID (required if not configured on server). base_url: Optional full API URL (overrides account_id).
Returns: Structured response with deletion result.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| record_type | Yes | ||
| record_id | Yes | ||
| account_id | No | ||
| base_url | No |
Implementation Reference
- src/my_mcp_server/server.py:686-713 (handler)The MCP tool handler that receives the request and calls the API client.
async def delete_record( record_type: str, record_id: str, account_id: Optional[str] = None, base_url: Optional[str] = None, ) -> Dict[str, Any]: """ Delete a record from the upstream API. Args: record_type: The type of record (e.g., "customer", "invoice") record_id: Internal ID of the record. account_id: Account ID (required if not configured on server). base_url: Optional full API URL (overrides account_id). Returns: Structured response with deletion result. """ token = _get_oauth_token() async with _get_client(base_url, account_id) as client: response = await client.delete_record( access_token=token, record_type=record_type, record_id=record_id, base_url_override=base_url, ) return _serialize_response(response) - src/my_mcp_server/api_client.py:432-452 (handler)The underlying API client implementation that performs the HTTP DELETE request.
async def delete_record( self, access_token: str, record_type: str, record_id: str, base_url_override: Optional[str] = None, ) -> APIResponse: """ Delete a record by ID. Args: access_token: OAuth Bearer token record_type: The record type/endpoint name record_id: The record's internal ID base_url_override: Override the base URL """ base = base_url_override or self._base_url url = f"{base}/{record_type}/{record_id}" logger.info(f"Deleting {record_type} #{record_id}") return await self._request_with_retry("DELETE", url, access_token) - src/my_mcp_server/server.py:685-686 (registration)Registration of the tool using the @mcp.tool decorator.
@mcp.tool() async def delete_record(