Skip to main content
Glama
michsob

PowerPlatform MCP

Export Solution

export-solution

Export Power Platform solutions as base64-encoded packages to serialize configurations for backup, migration, and deployment across environments.

Instructions

Export a solution as a base64-encoded package. This is a read-only operation that serializes the solution.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
solutionNameYesThe unique name of the solution to export
managedNoExport as managed solution (default: false)
environmentNoEnvironment name (e.g. DEV, UAT). Uses default if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
solutionNameYes
exportResultYes

Implementation Reference

  • Main handler implementation - SolutionService.exportSolution() method that performs the actual export operation via PowerPlatform API. Sends POST request to api/data/v9.2/ExportSolution with solution name and export options.
    /**
     * Export a solution as a base64-encoded package.
     * This is a read-only operation that serializes the solution for download.
     *
     * @param solutionName - The unique name of the solution to export
     * @param managed - Whether to export as a managed solution (default: false)
     */
    async exportSolution(
      solutionName: string,
      managed: boolean = false
    ): Promise<unknown> {
      return this.client.post(
        'api/data/v9.2/ExportSolution',
        {
          SolutionName: solutionName,
          Managed: managed,
          ExportAutoNumberingSettings: true,
          ExportCalendarSettings: true,
          ExportCustomizationSettings: true,
          ExportEmailTrackingSettings: true,
          ExportGeneralSettings: true,
          ExportMarketingSettings: true,
          ExportOutlookSynchronizationSettings: true,
          ExportRelationshipRoles: true,
          ExportIsvConfig: true,
          ExportSales: true,
          ExportExternalApplications: true,
        }
      );
    }
  • Tool registration - registers "export-solution" with the MCP server. Defines the tool name, description, input/output schemas, and handler wrapper function that calls service.exportSolution().
    // Export Solution
    server.registerTool(
      "export-solution",
      {
        title: "Export Solution",
        description: "Export a solution as a base64-encoded package. This is a read-only operation that serializes the solution.",
        inputSchema: {
          solutionName: z.string().describe("The unique name of the solution to export"),
          managed: z.boolean().optional().describe("Export as managed solution (default: false)"),
          environment: z.string().optional().describe("Environment name (e.g. DEV, UAT). Uses default if omitted."),
        },
        outputSchema: z.object({
          solutionName: z.string(),
          exportResult: z.any(),
        }),
      },
      async ({ solutionName, managed, environment }) => {
        try {
          const ctx = registry.getContext(environment);
          const service = ctx.getSolutionService();
          const result = await service.exportSolution(solutionName, managed ?? false);
    
          return {
            structuredContent: { solutionName, exportResult: result },
            content: [
              {
                type: "text",
                text: `Solution '${solutionName}' exported successfully (managed: ${managed ?? false}):\n\n${JSON.stringify(result, null, 2)}`,
              },
            ],
          };
        } catch (error: any) {
          console.error("Error exporting solution:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to export solution: ${error.message}`,
              },
            ],
          };
        }
      }
    );
  • Input/output schema definitions using Zod. Defines solutionName (string, required), managed (boolean, optional), environment (string, optional) inputs, and structured output with solutionName and exportResult.
    {
      title: "Export Solution",
      description: "Export a solution as a base64-encoded package. This is a read-only operation that serializes the solution.",
      inputSchema: {
        solutionName: z.string().describe("The unique name of the solution to export"),
        managed: z.boolean().optional().describe("Export as managed solution (default: false)"),
        environment: z.string().optional().describe("Environment name (e.g. DEV, UAT). Uses default if omitted."),
      },
      outputSchema: z.object({
        solutionName: z.string(),
        exportResult: z.any(),
      }),
Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden. It successfully conveys two critical behavioral traits: the read-only/safe nature of the operation and the base64 encoding of the output. It appropriately does not describe return values since an output schema exists.

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?

Two sentences with zero waste. The first sentence front-loads the core action and output format. The second sentence efficiently communicates the safety profile (read-only) and mechanism (serializes). Every word earns its place.

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?

For a 3-parameter export operation with an output schema, the description is appropriately complete. It discloses the critical encoding format (base64) that agents need to handle the response. Minor gap: could specify the package format type (e.g., ZIP) if applicable, but this is not essential.

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?

With 100% schema description coverage, the baseline score applies. The description does not explicitly discuss parameters, but the schema fully documents all three fields (solutionName, managed, environment). No additional semantic context (e.g., valid environment values) is added by the description.

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 (export), resource (solution), and distinguishing output format (base64-encoded package). This effectively differentiates it from sibling 'get-solution' which likely returns metadata rather than a serialized package.

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

Usage Guidelines3/5

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

While the 'read-only operation' statement provides safety context, the description lacks explicit guidance on when to choose this over 'get-solution' or other retrieval tools. The base64 format implies file-export use cases, but no explicit when-to-use/when-not-to-use guidance is provided.

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/michsob/powerplatform-mcp'

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