Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

Get Dataverse Relationship

get_dataverse_relationship

Retrieve detailed configuration and settings for Dataverse table relationships to understand table connections and cascade behavior.

Instructions

Retrieves detailed information about a specific relationship between Dataverse tables, including its configuration, cascade settings, and menu behavior. Use this to inspect relationship definitions and understand table connections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNameYesSchema name of the relationship to retrieve

Implementation Reference

  • The handler function retrieves the relationship metadata by querying the Dataverse metadata endpoint with the provided schemaName and returns formatted text content with the JSON response or error.
    async (params) => {
      try {
        const result = await client.getMetadata(
          `RelationshipDefinitions(SchemaName='${params.schemaName}')`
        );
    
        return {
          content: [
            {
              type: "text",
              text: `Relationship information for '${params.schemaName}':\n\n${JSON.stringify(result, null, 2)}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error retrieving relationship: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameter 'schemaName' as a required string.
    inputSchema: {
      schemaName: z.string().describe("Schema name of the relationship to retrieve")
    }
  • Function that registers the 'get_dataverse_relationship' tool with the MCP server, specifying name, title, description, input schema, and handler function. This is invoked from src/index.ts.
    export function getRelationshipTool(server: McpServer, client: DataverseClient) {
      server.registerTool(
        "get_dataverse_relationship",
        {
          title: "Get Dataverse Relationship",
          description: "Retrieves detailed information about a specific relationship between Dataverse tables, including its configuration, cascade settings, and menu behavior. Use this to inspect relationship definitions and understand table connections.",
          inputSchema: {
            schemaName: z.string().describe("Schema name of the relationship to retrieve")
          }
        },
        async (params) => {
          try {
            const result = await client.getMetadata(
              `RelationshipDefinitions(SchemaName='${params.schemaName}')`
            );
    
            return {
              content: [
                {
                  type: "text",
                  text: `Relationship information for '${params.schemaName}':\n\n${JSON.stringify(result, null, 2)}`
                }
              ]
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Error retrieving relationship: ${error instanceof Error ? error.message : 'Unknown error'}`
                }
              ],
              isError: true
            };
          }
        }
      );
    }
  • src/index.ts:154-154 (registration)
    Top-level invocation that calls getRelationshipTool to perform the tool registration during server initialization.
    getRelationshipTool(server, dataverseClient);
Behavior2/5

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

No annotations are provided, so the description carries full burden. While it indicates this is a read operation ('retrieves'), it doesn't disclose important behavioral traits like whether it requires specific permissions, potential rate limits, error conditions, or what format the detailed information returns. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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?

Two sentences with zero waste. The first sentence states the purpose and scope, the second provides usage guidance. Every word earns its place, and the information is front-loaded with the core functionality stated immediately.

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?

For a read operation with 100% schema coverage and no output schema, the description is adequate but has clear gaps. It explains what the tool does and when to use it, but lacks behavioral context (permissions, errors, format) that would be important for an agent to use it correctly. The absence of annotations and output schema means the description should do more to compensate.

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?

Schema description coverage is 100% with one parameter clearly documented. The description adds minimal value beyond the schema by implying the parameter identifies 'a specific relationship' but doesn't provide additional context about schemaName format, examples, or relationship identification. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/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 relationship between Dataverse tables', specifying what information is included (configuration, cascade settings, menu behavior). It distinguishes from sibling tools like 'list_dataverse_relationships' by focusing on a single relationship rather than listing multiple.

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

Usage Guidelines4/5

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

The description provides clear context: 'Use this to inspect relationship definitions and understand table connections.' This gives guidance on when to use the tool (for detailed inspection rather than listing). However, it doesn't explicitly mention when NOT to use it or name specific alternatives like 'list_dataverse_relationships' for broader overviews.

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