Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

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);

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