Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

delete_dataverse_optionset

Remove an option set from Microsoft Dataverse. This permanent deletion requires verifying no columns currently reference the option set before proceeding.

Instructions

Permanently deletes an option set from Dataverse. WARNING: This action cannot be undone and will fail if the option set is being used by any columns. Ensure no columns reference this option set before deletion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the option set to delete

Implementation Reference

  • The handler function that performs the deletion of the specified global option set using DataverseClient.deleteMetadata, including success response and error handling.
    async (params) => { try { await client.deleteMetadata(`GlobalOptionSetDefinitions(Name='${params.name}')`); return { content: [ { type: "text", text: `Successfully deleted option set '${params.name}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting option set: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • Zod schema for the tool input, requiring the name of the option set to delete.
    inputSchema: { name: z.string().describe("Name of the option set to delete") }
  • The server.registerTool call that registers the 'delete_dataverse_optionset' tool with its schema and handler.
    server.registerTool( "delete_dataverse_optionset", { title: "Delete Dataverse Option Set", description: "Permanently deletes an option set from Dataverse. WARNING: This action cannot be undone and will fail if the option set is being used by any columns. Ensure no columns reference this option set before deletion.", inputSchema: { name: z.string().describe("Name of the option set to delete") } }, async (params) => { try { await client.deleteMetadata(`GlobalOptionSetDefinitions(Name='${params.name}')`); return { content: [ { type: "text", text: `Successfully deleted option set '${params.name}'.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting option set: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
  • src/index.ts:162-162 (registration)
    Top-level call to register the option set tools, including deleteOptionSetTool, with the main MCP server.
    deleteOptionSetTool(server, dataverseClient);

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