Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

create_dataverse_solution

Create a new unmanaged solution container in Dataverse to package, deploy, and manage custom components like tables, columns, and other customizations.

Instructions

Creates a new unmanaged solution in Dataverse. Solutions are containers for customizations and allow you to package, deploy, and manage custom components. Use this to create a solution before adding tables, columns, and other customizations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the solution
friendlyNameYesFriendly name for the solution
publisherUniqueNameYesUnique name of the publisher to associate with this solution
uniqueNameYesUnique name for the solution (e.g., 'examplesolution')
versionNoVersion of the solution1.0.0.0

Implementation Reference

  • The core handler function implementing the tool logic: retrieves publisher by unique name, binds publisher ID to solution definition, creates unmanaged solution via Dataverse API POST /solutions, handles errors, and returns success/error markdown content.
    async (params) => { try { // First, get the publisher to get its ID const publisherResponse = await client.get(`publishers?$filter=uniquename eq '${params.publisherUniqueName}'&$select=publisherid`); if (!publisherResponse.value || publisherResponse.value.length === 0) { throw new Error(`Publisher with unique name '${params.publisherUniqueName}' not found`); } const publisherId = publisherResponse.value[0].publisherid; const solutionDefinition = { friendlyname: params.friendlyName, uniquename: params.uniqueName, description: params.description || `Solution for ${params.friendlyName}`, version: params.version, "publisherid@odata.bind": `/publishers(${publisherId})` }; const result = await client.post('solutions', solutionDefinition); return { content: [ { type: "text", text: `Successfully created solution '${params.friendlyName}' (${params.uniqueName}) linked to publisher '${params.publisherUniqueName}'.\n\nResponse: ${JSON.stringify(result, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error creating solution: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
  • Input/output schema definition for the tool, using Zod validators for required parameters (friendlyName, uniqueName, publisherUniqueName) and optional fields, with descriptive annotations.
    { title: "Create Dataverse Solution", description: "Creates a new unmanaged solution in Dataverse. Solutions are containers for customizations and allow you to package, deploy, and manage custom components. Use this to create a solution before adding tables, columns, and other customizations.", inputSchema: { friendlyName: z.string().describe("Friendly name for the solution"), uniqueName: z.string().describe("Unique name for the solution (e.g., 'examplesolution')"), description: z.string().optional().describe("Description of the solution"), version: z.string().default("1.0.0.0").describe("Version of the solution"), publisherUniqueName: z.string().describe("Unique name of the publisher to associate with this solution") } },
  • The registration helper function that calls server.registerTool with the tool name 'create_dataverse_solution', schema, and handler. This modular function is imported and invoked from src/index.ts.
    export function createSolutionTool(server: McpServer, client: DataverseClient) { server.registerTool( "create_dataverse_solution", { title: "Create Dataverse Solution", description: "Creates a new unmanaged solution in Dataverse. Solutions are containers for customizations and allow you to package, deploy, and manage custom components. Use this to create a solution before adding tables, columns, and other customizations.", inputSchema: { friendlyName: z.string().describe("Friendly name for the solution"), uniqueName: z.string().describe("Unique name for the solution (e.g., 'examplesolution')"), description: z.string().optional().describe("Description of the solution"), version: z.string().default("1.0.0.0").describe("Version of the solution"), publisherUniqueName: z.string().describe("Unique name of the publisher to associate with this solution") } }, async (params) => { try { // First, get the publisher to get its ID const publisherResponse = await client.get(`publishers?$filter=uniquename eq '${params.publisherUniqueName}'&$select=publisherid`); if (!publisherResponse.value || publisherResponse.value.length === 0) { throw new Error(`Publisher with unique name '${params.publisherUniqueName}' not found`); } const publisherId = publisherResponse.value[0].publisherid; const solutionDefinition = { friendlyname: params.friendlyName, uniquename: params.uniqueName, description: params.description || `Solution for ${params.friendlyName}`, version: params.version, "publisherid@odata.bind": `/publishers(${publisherId})` }; const result = await client.post('solutions', solutionDefinition); return { content: [ { type: "text", text: `Successfully created solution '${params.friendlyName}' (${params.uniqueName}) linked to publisher '${params.publisherUniqueName}'.\n\nResponse: ${JSON.stringify(result, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error creating solution: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
  • src/index.ts:168-168 (registration)
    Top-level invocation of the tool registration helper in the main MCP server initialization script, passing the server instance and Dataverse client.
    createSolutionTool(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