Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Create Dataverse Solution

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);
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It correctly identifies this as a creation/mutation operation ('Creates'), but doesn't mention permission requirements, whether the solution is immediately usable, potential rate limits, or what happens if a solution with the same unique name exists. It adds some context about solutions being 'containers for customizations' but lacks operational details.

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 efficiently structured in two sentences: the first states the core action and defines what solutions are, the second provides usage guidance. Every word earns its place with no redundancy or fluff, and key information is front-loaded.

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

Completeness3/5

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

For a creation tool with no annotations and no output schema, the description provides adequate basic context about what solutions are and when to use this tool. However, it doesn't describe what the tool returns (e.g., solution ID, confirmation message) or address potential error conditions. Given the mutation nature and lack of structured output information, more behavioral details would be helpful.

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, providing clear documentation for all 5 parameters. The description doesn't add any parameter-specific information beyond what's in the schema, but it does provide the overall context that solutions are for 'packaging, deploying, and managing custom components,' which helps understand why these parameters matter. Baseline 3 is appropriate given complete 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 ('Creates a new unmanaged solution'), identifies the resource ('in Dataverse'), and distinguishes it from siblings by focusing on solution creation rather than other Dataverse operations like creating tables, columns, or publishers. It explains what solutions are used for, providing context beyond just the action.

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 for when to use this tool ('Use this to create a solution before adding tables, columns, and other customizations'), establishing it as a prerequisite step in a customization workflow. However, it doesn't explicitly mention when NOT to use it or name specific alternatives among the many sibling tools, such as 'create_dataverse_publisher' which might be needed first.

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