get_dataverse_optionset
Retrieve detailed metadata and configuration for specific Dataverse option sets to inspect available choices and understand field definitions.
Instructions
Retrieves detailed information about a specific option set including its metadata, options, and configuration. Use this to inspect option set definitions and understand available choices.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the option set to retrieve |
Implementation Reference
- src/tools/optionset-tools.ts:103-128 (handler)Handler function that executes the get_dataverse_optionset tool by fetching the option set metadata from Dataverse.async (params) => { try { const result = await client.getMetadata<OptionSetMetadata>( `GlobalOptionSetDefinitions(Name='${params.name}')` ); return { content: [ { type: "text", text: `Option set information for '${params.name}':\n\n${JSON.stringify(result, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving option set: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- src/tools/optionset-tools.ts:96-102 (schema)Schema definition for the get_dataverse_optionset tool, including title, description, and input schema.{ title: "Get Dataverse Option Set", description: "Retrieves detailed information about a specific option set including its metadata, options, and configuration. Use this to inspect option set definitions and understand available choices.", inputSchema: { name: z.string().describe("Name of the option set to retrieve") } },
- src/tools/optionset-tools.ts:93-130 (registration)Registration of the get_dataverse_optionset tool via the getOptionSetTool function, which includes schema and handler.export function getOptionSetTool(server: McpServer, client: DataverseClient) { server.registerTool( "get_dataverse_optionset", { title: "Get Dataverse Option Set", description: "Retrieves detailed information about a specific option set including its metadata, options, and configuration. Use this to inspect option set definitions and understand available choices.", inputSchema: { name: z.string().describe("Name of the option set to retrieve") } }, async (params) => { try { const result = await client.getMetadata<OptionSetMetadata>( `GlobalOptionSetDefinitions(Name='${params.name}')` ); return { content: [ { type: "text", text: `Option set information for '${params.name}':\n\n${JSON.stringify(result, null, 2)}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error retrieving option set: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } ); }