delete_dataverse_column
Remove unwanted columns from Dataverse tables to clean up database schema and eliminate unnecessary data storage.
Instructions
Permanently deletes a column from a Dataverse table. WARNING: This action cannot be undone and will remove all data stored in this column. Use with extreme caution and only for columns that are no longer needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entityLogicalName | Yes | Logical name of the table | |
| logicalName | Yes | Logical name of the column to delete |
Implementation Reference
- src/tools/column-tools.ts:451-476 (handler)The main handler function that executes the tool logic by deleting the specified Dataverse column using the metadata API.async (params) => { try { await client.deleteMetadata( `EntityDefinitions(LogicalName='${params.entityLogicalName}')/Attributes(LogicalName='${params.logicalName}')` ); return { content: [ { type: "text", text: `Successfully deleted column '${params.logicalName}' from table '${params.entityLogicalName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting column: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/column-tools.ts:443-450 (schema)Input schema and tool metadata (title, description) for the delete_dataverse_column tool using Zod validation.{ title: "Delete Dataverse Column", description: "Permanently deletes a column from a Dataverse table. WARNING: This action cannot be undone and will remove all data stored in this column. Use with extreme caution and only for columns that are no longer needed.", inputSchema: { entityLogicalName: z.string().describe("Logical name of the table"), logicalName: z.string().describe("Logical name of the column to delete") } },
- src/tools/column-tools.ts:441-477 (registration)Registers the delete_dataverse_column tool on the MCP server inside the deleteColumnTool function.server.registerTool( "delete_dataverse_column", { title: "Delete Dataverse Column", description: "Permanently deletes a column from a Dataverse table. WARNING: This action cannot be undone and will remove all data stored in this column. Use with extreme caution and only for columns that are no longer needed.", inputSchema: { entityLogicalName: z.string().describe("Logical name of the table"), logicalName: z.string().describe("Logical name of the column to delete") } }, async (params) => { try { await client.deleteMetadata( `EntityDefinitions(LogicalName='${params.entityLogicalName}')/Attributes(LogicalName='${params.logicalName}')` ); return { content: [ { type: "text", text: `Successfully deleted column '${params.logicalName}' from table '${params.entityLogicalName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting column: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- src/index.ts:149-149 (registration)Top-level call to deleteColumnTool function which triggers the tool registration on the main server instance.deleteColumnTool(server, dataverseClient);