get-global-option-set
Retrieve global option set definitions by name to access standardized data values in PowerPlatform/Dataverse environments.
Instructions
Get a global option set definition by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| optionSetName | Yes | The name of the global option set |
Implementation Reference
- src/index.ts:509-537 (handler)The handler function that executes the tool: initializes PowerPlatformService, calls getGlobalOptionSet, formats as JSON text response, handles errors.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}`, }, ], }; } }
- src/index.ts:506-508 (schema)Zod input schema defining the required 'optionSetName' parameter.{ optionSetName: z.string().describe("The name of the global option set"), },
- src/index.ts:503-505 (registration)Registration of the tool using server.tool() with name, description, and schema reference.server.tool( "get-global-option-set", "Get a global option set definition by name",
- src/PowerPlatformService.ts:239-241 (helper)Helper method in PowerPlatformService that makes the API request to fetch the global option set metadata by name.async getGlobalOptionSet(optionSetName: string): Promise<any> { return this.makeRequest(`api/data/v9.2/GlobalOptionSetDefinitions(Name='${optionSetName}')`); }