delete_dataverse_table
Permanently remove custom tables from Dataverse. This irreversible action deletes all table data and cannot be undone. Use only for tables no longer needed.
Instructions
Permanently deletes a custom table from Dataverse. WARNING: This action cannot be undone and will remove all data in the table. Use with extreme caution and only for tables that are no longer needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logicalName | Yes | Logical name of the table to delete |
Implementation Reference
- src/tools/table-tools.ts:318-351 (registration)Tool registration for 'delete_dataverse_table', including schema and handler function.server.registerTool( "delete_dataverse_table", { title: "Delete Dataverse Table", description: "Permanently deletes a custom table from Dataverse. WARNING: This action cannot be undone and will remove all data in the table. Use with extreme caution and only for tables that are no longer needed.", inputSchema: { logicalName: z.string().describe("Logical name of the table to delete") } }, async (params) => { try { await client.deleteMetadata(`EntityDefinitions(LogicalName='${params.logicalName}')`); return { content: [ { type: "text", text: `Successfully deleted table '${params.logicalName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting table: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- src/tools/table-tools.ts:327-350 (handler)The handler function that performs the deletion by calling deleteMetadata on the Dataverse client.async (params) => { try { await client.deleteMetadata(`EntityDefinitions(LogicalName='${params.logicalName}')`); return { content: [ { type: "text", text: `Successfully deleted table '${params.logicalName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting table: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/table-tools.ts:323-325 (schema)Input schema defining the required 'logicalName' parameter using Zod.inputSchema: { logicalName: z.string().describe("Logical name of the table to delete") }
- src/tools/table-tools.ts:317-352 (helper)Helper function that registers the delete_dataverse_table tool.export function deleteTableTool(server: McpServer, client: DataverseClient) { server.registerTool( "delete_dataverse_table", { title: "Delete Dataverse Table", description: "Permanently deletes a custom table from Dataverse. WARNING: This action cannot be undone and will remove all data in the table. Use with extreme caution and only for tables that are no longer needed.", inputSchema: { logicalName: z.string().describe("Logical name of the table to delete") } }, async (params) => { try { await client.deleteMetadata(`EntityDefinitions(LogicalName='${params.logicalName}')`); return { content: [ { type: "text", text: `Successfully deleted table '${params.logicalName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting table: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }