Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Get Dataverse Option Set

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
NameRequiredDescriptionDefault
nameYesName of the option set to retrieve

Implementation Reference

  • 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
        };
      }
    }
  • 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")
      }
    },
  • 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
            };
          }
        }
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions retrieving 'detailed information' but doesn't disclose behavioral traits such as whether this is a read-only operation (implied by 'Retrieves'), error handling for non-existent option sets, authentication needs, rate limits, or response format. This leaves significant gaps for a tool that likely interacts with a database system.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose and followed by a usage hint. Every sentence earns its place by adding value without redundancy, making it efficient and well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no nested objects) and high schema coverage, the description is adequate but incomplete. It lacks output schema, so it doesn't explain return values like the structure of metadata or options, and with no annotations, it misses behavioral context. For a retrieval tool, this is minimally viable but leaves room for improvement in detailing response format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'name' parameter documented as 'Name of the option set to retrieve.' The description adds minimal value beyond this, only implying the parameter is used to specify which option set. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't provide additional syntax or format details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Retrieves') and resource ('detailed information about a specific option set'), specifying what metadata is included. It distinguishes from siblings like 'list_dataverse_optionsets' by focusing on a single option set rather than listing multiple. However, it doesn't explicitly contrast with 'get_dataverse_optionset_options' (a sibling tool), which might retrieve just the options, not the full metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating 'Use this to inspect option set definitions and understand available choices,' which suggests it's for detailed inspection rather than listing. However, it lacks explicit guidance on when to use this versus alternatives like 'list_dataverse_optionsets' for overviews or 'get_dataverse_optionset_options' for just options, and doesn't mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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