Skip to main content
Glama

get-entity-metadata

Retrieve metadata for PowerPlatform entities to understand structure, fields, and relationships for integration and development.

Instructions

Get metadata about a PowerPlatform entity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNameYesThe logical name of the entity

Implementation Reference

  • The MCP tool handler function for 'get-entity-metadata'. It initializes the PowerPlatformService if needed, calls getEntityMetadata on it, stringifies the result as JSON, and returns it in the required MCP content format. Handles errors gracefully.
    async ({ entityName }) => { try { // Get or initialize PowerPlatformService const service = getPowerPlatformService(); const metadata = await service.getEntityMetadata(entityName); // Format the metadata as a string for text display const metadataStr = JSON.stringify(metadata, null, 2); return { content: [ { type: "text", text: `Entity metadata for '${entityName}':\n\n${metadataStr}`, }, ], }; } catch (error: any) { console.error("Error getting entity metadata:", error); return { content: [ { type: "text", text: `Failed to get entity metadata: ${error.message}`, }, ], }; } } );
  • Zod schema for input validation of the tool, requiring 'entityName' as a string with description.
    { entityName: z.string().describe("The logical name of the entity"), },
  • src/index.ts:350-352 (registration)
    Registration of the 'get-entity-metadata' tool on the MCP server with name and description.
    server.tool( "get-entity-metadata", "Get metadata about a PowerPlatform entity",
  • Core helper method in PowerPlatformService that performs the authenticated API request to Dataverse Web API to fetch entity metadata by logical name, removes Privileges property, and returns the data.
    async getEntityMetadata(entityName: string): Promise<any> { const response = await this.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')`); // Remove Privileges property if it exists if (response && typeof response === 'object' && 'Privileges' in response) { delete response.Privileges; } return response; }

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/michsob/powerplatform-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server