Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Set Business Unit Parent

set_businessunit_parent

Change the parent business unit to reorganize organizational hierarchy and reporting relationships in Microsoft Dataverse.

Instructions

Changes the parent business unit for a given business unit, effectively moving it within the organizational hierarchy. Use this to reorganize business unit structure and reporting relationships.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
businessUnitIdYesUnique identifier of the business unit
parentBusinessUnitIdYesUnique identifier of the new parent business unit

Implementation Reference

  • The core handler function that calls the Dataverse 'SetParentBusinessUnit' action using the provided businessUnitId and parentBusinessUnitId parameters, handling success and error responses.
    async (params: any) => {
      try {
        // Use the SetParentBusinessUnit action
        await client.callAction('SetParentBusinessUnit', {
          BusinessUnitId: params.businessUnitId,
          ParentId: params.parentBusinessUnitId
        });
    
        return {
          content: [
            {
              type: "text",
              text: "Successfully set business unit parent"
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting business unit parent: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Tool metadata including title, description, and Zod input schema validating businessUnitId and parentBusinessUnitId as required strings.
    {
      title: "Set Business Unit Parent",
      description: "Changes the parent business unit for a given business unit, effectively moving it within the organizational hierarchy. Use this to reorganize business unit structure and reporting relationships.",
      inputSchema: {
        businessUnitId: z.string().describe("Unique identifier of the business unit"),
        parentBusinessUnitId: z.string().describe("Unique identifier of the new parent business unit")
      }
    },
  • The server.registerTool call that registers the 'set_businessunit_parent' tool with its schema and handler function.
    server.registerTool(
      "set_businessunit_parent",
      {
        title: "Set Business Unit Parent",
        description: "Changes the parent business unit for a given business unit, effectively moving it within the organizational hierarchy. Use this to reorganize business unit structure and reporting relationships.",
        inputSchema: {
          businessUnitId: z.string().describe("Unique identifier of the business unit"),
          parentBusinessUnitId: z.string().describe("Unique identifier of the new parent business unit")
        }
      },
      async (params: any) => {
        try {
          // Use the SetParentBusinessUnit action
          await client.callAction('SetParentBusinessUnit', {
            BusinessUnitId: params.businessUnitId,
            ParentId: params.parentBusinessUnitId
          });
    
          return {
            content: [
              {
                type: "text",
                text: "Successfully set business unit parent"
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting business unit parent: ${error instanceof Error ? error.message : 'Unknown error'}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • src/index.ts:220-220 (registration)
    Invocation of setBusinessUnitParentTool to register the tool on the MCP server during server initialization.
    setBusinessUnitParentTool(server, dataverseClient);
  • src/index.ts:82-82 (registration)
    Import of the setBusinessUnitParentTool function from businessunit-tools.
    setBusinessUnitParentTool,
Behavior2/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 indicates this is a mutation tool ('changes', 'moving'), implying it modifies data, but fails to disclose critical behavioral traits such as required permissions, whether changes are reversible, potential side effects (e.g., impact on reporting or access), or error conditions. This leaves significant gaps for safe and effective use.

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

Conciseness4/5

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

The description is appropriately sized with two sentences that are front-loaded: the first states the core action, and the second provides usage context. There's no wasted text, and it efficiently conveys the tool's purpose without redundancy, though it could be slightly more structured for clarity.

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

Completeness2/5

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

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects (e.g., permissions, reversibility), expected outcomes, or error handling, which are crucial for a tool that modifies organizational structure. This makes it inadequate for safe agent use without additional context.

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, clearly documenting both parameters ('businessUnitId' and 'parentBusinessUnitId') as unique identifiers. The description adds minimal value beyond the schema by implying the parameters are used for moving within a hierarchy, but doesn't provide additional semantics like format examples or constraints. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose with specific verbs ('changes', 'moving') and resources ('business unit', 'organizational hierarchy'), distinguishing it from siblings like 'update_dataverse_businessunit' or 'create_dataverse_businessunit'. However, it doesn't explicitly differentiate from all siblings, such as 'get_businessunit_hierarchy', which is related but for reading rather than modifying.

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?

The description provides implied usage context by stating 'Use this to reorganize business unit structure and reporting relationships', which suggests when to apply it. However, it lacks explicit guidance on when not to use it (e.g., vs. creating or deleting business units) or alternatives, and doesn't mention prerequisites like permissions or dependencies.

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