Skip to main content
Glama
mwhesse

Dataverse MCP Server

by mwhesse

List Dataverse Tables

list_dataverse_tables

Retrieve and filter Dataverse tables to discover available data models, find custom tables, or get an overview of table structure with custom/system and managed/unmanaged filtering options.

Instructions

Retrieves a list of tables in the Dataverse environment with filtering options. Use this to discover available tables, find custom tables, or get an overview of the data model. Supports filtering by custom/system tables and managed/unmanaged status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customOnlyNoWhether to list only custom tables
filterNoOData filter expression
includeManagedNoWhether to include managed tables

Implementation Reference

  • The handler function for 'list_dataverse_tables' tool. It constructs an OData query for EntityDefinitions with filters based on input parameters (customOnly, includeManaged, filter), retrieves the metadata using client.getMetadata, processes the results into a simplified table list, and returns formatted text output or error.
    async (params) => {
      try {
        let queryParams: Record<string, any> = {
          $select: "LogicalName,DisplayName,DisplayCollectionName,IsCustomEntity,IsManaged,OwnershipType,HasActivities,HasNotes"
        };
    
        let filters: string[] = [];
        
        if (params.customOnly) {
          filters.push("IsCustomEntity eq true");
        }
        
        if (!params.includeManaged) {
          filters.push("IsManaged eq false");
        }
    
        if (params.filter) {
          filters.push(params.filter);
        }
    
        if (filters.length > 0) {
          queryParams.$filter = filters.join(" and ");
        }
    
        const result = await client.getMetadata<ODataResponse<EntityMetadata>>("EntityDefinitions", queryParams);
    
        const tableList = result.value.map(entity => ({
          logicalName: entity.LogicalName,
          displayName: entity.DisplayName?.UserLocalizedLabel?.Label || entity.LogicalName,
          displayCollectionName: entity.DisplayCollectionName?.UserLocalizedLabel?.Label || "",
          isCustom: entity.IsCustomEntity,
          isManaged: entity.IsManaged,
          ownershipType: entity.OwnershipType,
          hasActivities: entity.HasActivities,
          hasNotes: entity.HasNotes
        }));
    
        return {
          content: [
            {
              type: "text",
              text: `Found ${tableList.length} tables:\n\n${JSON.stringify(tableList, null, 2)}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error listing tables: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema defining the parameters for the list_dataverse_tables tool: customOnly (boolean, default false), includeManaged (boolean, default false), filter (optional string for OData filter).
    inputSchema: {
      customOnly: z.boolean().default(false).describe("Whether to list only custom tables"),
      includeManaged: z.boolean().default(false).describe("Whether to include managed tables"),
      filter: z.string().optional().describe("OData filter expression")
    }
  • The exported listTablesTool function that registers the 'list_dataverse_tables' MCP tool with the server, including its title, description, input schema, and handler.
    export function listTablesTool(server: McpServer, client: DataverseClient) {
      server.registerTool(
        "list_dataverse_tables",
        {
          title: "List Dataverse Tables",
          description: "Retrieves a list of tables in the Dataverse environment with filtering options. Use this to discover available tables, find custom tables, or get an overview of the data model. Supports filtering by custom/system tables and managed/unmanaged status.",
          inputSchema: {
            customOnly: z.boolean().default(false).describe("Whether to list only custom tables"),
            includeManaged: z.boolean().default(false).describe("Whether to include managed tables"),
            filter: z.string().optional().describe("OData filter expression")
          }
        },
        async (params) => {
          try {
            let queryParams: Record<string, any> = {
              $select: "LogicalName,DisplayName,DisplayCollectionName,IsCustomEntity,IsManaged,OwnershipType,HasActivities,HasNotes"
            };
    
            let filters: string[] = [];
            
            if (params.customOnly) {
              filters.push("IsCustomEntity eq true");
            }
            
            if (!params.includeManaged) {
              filters.push("IsManaged eq false");
            }
    
            if (params.filter) {
              filters.push(params.filter);
            }
    
            if (filters.length > 0) {
              queryParams.$filter = filters.join(" and ");
            }
    
            const result = await client.getMetadata<ODataResponse<EntityMetadata>>("EntityDefinitions", queryParams);
    
            const tableList = result.value.map(entity => ({
              logicalName: entity.LogicalName,
              displayName: entity.DisplayName?.UserLocalizedLabel?.Label || entity.LogicalName,
              displayCollectionName: entity.DisplayCollectionName?.UserLocalizedLabel?.Label || "",
              isCustom: entity.IsCustomEntity,
              isManaged: entity.IsManaged,
              ownershipType: entity.OwnershipType,
              hasActivities: entity.HasActivities,
              hasNotes: entity.HasNotes
            }));
    
            return {
              content: [
                {
                  type: "text",
                  text: `Found ${tableList.length} tables:\n\n${JSON.stringify(tableList, null, 2)}`
                }
              ]
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Error listing tables: ${error instanceof Error ? error.message : 'Unknown error'}`
                }
              ],
              isError: true
            };
          }
        }
      );
    }
  • src/index.ts:143-143 (registration)
    Top-level call in the main entry point that invokes listTablesTool to register the tool with the MCP server instance.
    listTablesTool(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 the full burden of behavioral disclosure. It mentions 'filtering options' and 'supports filtering by custom/system tables and managed/unmanaged status,' which adds some context about capabilities. However, it doesn't describe critical behaviors like whether this is a read-only operation (implied by 'retrieves' but not explicit), potential rate limits, authentication requirements, pagination, or error conditions. For a list tool with zero annotation coverage, this leaves significant gaps.

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 efficiently structured in two sentences. The first sentence states the core purpose, and the second adds usage context and filtering details. Every sentence earns its place with no redundant information, making it appropriately sized and front-loaded 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 moderate complexity (list operation with filtering), no annotations, and no output schema, the description is partially complete. It covers the purpose and usage scenarios but lacks details on behavioral traits (e.g., read-only nature, response format, pagination) that would be crucial for an AI agent. With no output schema, the description should ideally hint at return values, but it doesn't, leaving gaps in contextual understanding.

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 all three parameters well-documented in the schema itself. The description adds marginal value by mentioning 'filtering by custom/system tables and managed/unmanaged status,' which loosely maps to the 'customOnly' and 'includeManaged' parameters but doesn't provide additional syntax or format details beyond what the schema already states. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't significantly enhance parameter understanding.

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 tool's purpose: 'Retrieves a list of tables in the Dataverse environment with filtering options.' It specifies the verb ('retrieves'), resource ('tables in the Dataverse environment'), and scope ('with filtering options'). However, it doesn't explicitly differentiate from sibling tools like 'get_dataverse_table' (which likely retrieves a single table) or 'list_dataverse_columns' (which lists columns), so it misses full sibling distinction.

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 usage context: 'Use this to discover available tables, find custom tables, or get an overview of the data model.' This gives practical scenarios for when to use the tool. However, it doesn't explicitly state when not to use it or name alternatives (e.g., 'get_dataverse_table' for single table details), so it lacks full exclusion guidance.

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