Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

assign_role_to_team

Assign security roles to teams to provide consistent access permissions for groups of users working on similar tasks in Microsoft Dataverse.

Instructions

Assigns a security role to a team, granting all team members the permissions defined in that role. Use this to provide consistent access levels to groups of users working together on similar tasks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleIdYesID of the role to assign
teamIdYesID of the team to assign the role to

Implementation Reference

  • The exported assignRoleToTeamTool function defines and registers the MCP tool 'assign_role_to_team' with Zod input schema and async handler that performs the role assignment via Dataverse Web API.
    export function assignRoleToTeamTool(server: McpServer, client: DataverseClient) { server.registerTool( "assign_role_to_team", { title: "Assign Role to Team", description: "Assigns a security role to a team, granting all team members the permissions defined in that role. Use this to provide consistent access levels to groups of users working together on similar tasks.", inputSchema: { roleId: z.string().describe("ID of the role to assign"), teamId: z.string().describe("ID of the team to assign the role to") } }, async (params) => { try { await client.post(`teams(${params.teamId})/teamroles_association/$ref`, { "@odata.id": `${client['config'].dataverseUrl}/api/data/v9.2/roles(${params.roleId})` }); return { content: [ { type: "text", text: `Successfully assigned role to team.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error assigning role to team: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }
  • src/index.ts:195-195 (registration)
    Invocation of assignRoleToTeamTool to register the tool on the main MCP server instance.
    assignRoleToTeamTool(server, dataverseClient);
  • Tool metadata including title, description, and Zod input schema for validation.
    { title: "Assign Role to Team", description: "Assigns a security role to a team, granting all team members the permissions defined in that role. Use this to provide consistent access levels to groups of users working together on similar tasks.", inputSchema: { roleId: z.string().describe("ID of the role to assign"), teamId: z.string().describe("ID of the team to assign the role to") } },
  • The core handler logic that posts to the Dataverse Web API endpoint to associate the role with the team.
    async (params) => { try { await client.post(`teams(${params.teamId})/teamroles_association/$ref`, { "@odata.id": `${client['config'].dataverseUrl}/api/data/v9.2/roles(${params.roleId})` }); return { content: [ { type: "text", text: `Successfully assigned role to team.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error assigning role to team: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );

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