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
| Name | Required | Description | Default |
|---|---|---|---|
| businessUnitId | Yes | Unique identifier of the business unit | |
| parentBusinessUnitId | Yes | Unique identifier of the new parent business unit |
Implementation Reference
- src/tools/businessunit-tools.ts:539-566 (handler)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") } },
- src/tools/businessunit-tools.ts:529-567 (registration)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,