Skip to main content
Glama

get-global-option-set

Retrieve the definition of a global option set by specifying its name, enabling precise metadata access within the PowerPlatform/Dataverse environment.

Instructions

Get a global option set definition by name

Input Schema

NameRequiredDescriptionDefault
optionSetNameYesThe name of the global option set

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "optionSetName": { "description": "The name of the global option set", "type": "string" } }, "required": [ "optionSetName" ], "type": "object" }

Implementation Reference

  • The MCP tool handler function that calls PowerPlatformService.getGlobalOptionSet, formats the JSON response as text content.
    async ({ optionSetName }) => { try { // Get or initialize PowerPlatformService const service = getPowerPlatformService(); const optionSet = await service.getGlobalOptionSet(optionSetName); // Format the option set as a string for text display const optionSetStr = JSON.stringify(optionSet, null, 2); return { content: [ { type: "text", text: `Global option set '${optionSetName}':\n\n${optionSetStr}`, }, ], }; } catch (error: any) { console.error("Error getting global option set:", error); return { content: [ { type: "text", text: `Failed to get global option set: ${error.message}`, }, ], }; } }
  • Zod input schema defining 'optionSetName' parameter for the tool.
    { optionSetName: z.string().describe("The name of the global option set"), },
  • src/index.ts:503-538 (registration)
    Registration of the 'get-global-option-set' tool using McpServer.tool() method, including name, description, input schema, and handler.
    server.tool( "get-global-option-set", "Get a global option set definition by name", { optionSetName: z.string().describe("The name of the global option set"), }, async ({ optionSetName }) => { try { // Get or initialize PowerPlatformService const service = getPowerPlatformService(); const optionSet = await service.getGlobalOptionSet(optionSetName); // Format the option set as a string for text display const optionSetStr = JSON.stringify(optionSet, null, 2); return { content: [ { type: "text", text: `Global option set '${optionSetName}':\n\n${optionSetStr}`, }, ], }; } catch (error: any) { console.error("Error getting global option set:", error); return { content: [ { type: "text", text: `Failed to get global option set: ${error.message}`, }, ], }; } } );
  • Helper method in PowerPlatformService class that makes the authenticated API request to retrieve the global option set metadata from Dataverse.
    async getGlobalOptionSet(optionSetName: string): Promise<any> { return this.makeRequest(`api/data/v9.2/GlobalOptionSetDefinitions(Name='${optionSetName}')`); }

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