Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Delete Dataverse Relationship

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
NameRequiredDescriptionDefault
schemaNameYesSchema name of the relationship to delete

Implementation Reference

  • 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")
    }
  • 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
        };
      }
    }
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description carries the full burden. It effectively discloses critical behavioral traits: the action is permanent ('cannot be undone'), destructive ('will remove the connection between tables'), and has side effects ('including any lookup fields for One-to-Many relationships'). This covers safety and impact beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences that are front-loaded with the core action and warning. Every sentence earns its place by conveying purpose, consequences, and caution without unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive deletion), lack of annotations, and no output schema, the description does well by covering key behavioral aspects like permanence and side effects. However, it could be more complete by mentioning prerequisites (e.g., permissions needed) or what happens after deletion (e.g., error handling), though the warning suffices for most contexts.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the parameter 'schemaName' clearly documented. The description does not add any additional meaning or context about the parameter beyond what the schema provides, so it meets the baseline of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('permanently deletes'), the resource ('a relationship between Dataverse tables'), and distinguishes it from sibling tools like 'create_dataverse_relationship' and 'get_dataverse_relationship'. It goes beyond just restating the name/title by specifying the scope of deletion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context with 'Use with extreme caution' and the warning about irreversibility, which helps guide when to use it. However, it does not explicitly mention when NOT to use it or name specific alternatives (e.g., 'update_dataverse_relationship' might be an alternative for modifying rather than deleting).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mwhesse/mcp-dataverse'

If you have feedback or need assistance with the MCP directory API, please join our Discord server