delete_dataverse_relationship
Permanently remove relationships between Dataverse tables to eliminate table connections and lookup fields. This irreversible action requires careful consideration before execution.
Instructions
Permanently deletes a relationship between Dataverse tables. WARNING: This action cannot be undone and will remove the connection between tables, including any lookup fields for One-to-Many relationships. Use with extreme caution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schemaName | Yes | Schema name of the relationship to delete |
Implementation Reference
- src/tools/relationship-tools.ts:238-273 (registration)Exports and defines the deleteRelationshipTool function which registers the 'delete_dataverse_relationship' MCP tool using server.registerTool, including title, description, inputSchema, and handler function.export function deleteRelationshipTool(server: McpServer, client: DataverseClient) { server.registerTool( "delete_dataverse_relationship", { title: "Delete Dataverse Relationship", description: "Permanently deletes a relationship between Dataverse tables. WARNING: This action cannot be undone and will remove the connection between tables, including any lookup fields for One-to-Many relationships. Use with extreme caution.", inputSchema: { schemaName: z.string().describe("Schema name of the relationship to delete") } }, async (params) => { try { await client.deleteMetadata(`RelationshipDefinitions(SchemaName='${params.schemaName}')`); return { content: [ { type: "text", text: `Successfully deleted relationship '${params.schemaName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting relationship: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
- Zod input schema for the tool, requiring the schemaName of the relationship to delete.inputSchema: { schemaName: z.string().describe("Schema name of the relationship to delete") }
- src/tools/relationship-tools.ts:248-271 (handler)The async handler function that executes the tool logic: deletes the relationship metadata using the DataverseClient's deleteMetadata method and returns success or error response.async (params) => { try { await client.deleteMetadata(`RelationshipDefinitions(SchemaName='${params.schemaName}')`); return { content: [ { type: "text", text: `Successfully deleted relationship '${params.schemaName}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting relationship: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }