Skip to main content
Glama
michsob

PowerPlatform MCP

get-entity-attribute

Retrieve specific attribute details from PowerPlatform entities to access metadata and field information for development and integration tasks.

Instructions

Get a specific attribute/field of a PowerPlatform entity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNameYesThe logical name of the entity
attributeNameYesThe logical name of the attribute

Implementation Reference

  • Handler function for the 'get-entity-attribute' MCP tool. Delegates to PowerPlatformService.getEntityAttribute and formats the response as text.
      async ({ entityName, attributeName }) => {
        try {
          // Get or initialize PowerPlatformService
          const service = getPowerPlatformService();
          const attribute = await service.getEntityAttribute(entityName, attributeName);
          
          // Format the attribute as a string for text display
          const attributeStr = JSON.stringify(attribute, null, 2);
          
          return {
            content: [
              {
                type: "text",
                text: `Attribute '${attributeName}' for entity '${entityName}':\n\n${attributeStr}`,
              },
            ],
          };
        } catch (error: any) {
          console.error("Error getting entity attribute:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to get entity attribute: ${error.message}`,
              },
            ],
          };
        }
      }
    );
  • Zod input schema defining parameters for entityName and attributeName.
    {
      entityName: z.string().describe("The logical name of the entity"),
      attributeName: z.string().describe("The logical name of the attribute")
    },
  • src/index.ts:426-465 (registration)
    Registration of the 'get-entity-attribute' tool using server.tool, including schema and handler.
    server.tool(
      "get-entity-attribute",
      "Get a specific attribute/field of a PowerPlatform entity",
      {
        entityName: z.string().describe("The logical name of the entity"),
        attributeName: z.string().describe("The logical name of the attribute")
      },
      async ({ entityName, attributeName }) => {
        try {
          // Get or initialize PowerPlatformService
          const service = getPowerPlatformService();
          const attribute = await service.getEntityAttribute(entityName, attributeName);
          
          // Format the attribute as a string for text display
          const attributeStr = JSON.stringify(attribute, null, 2);
          
          return {
            content: [
              {
                type: "text",
                text: `Attribute '${attributeName}' for entity '${entityName}':\n\n${attributeStr}`,
              },
            ],
          };
        } catch (error: any) {
          console.error("Error getting entity attribute:", error);
          return {
            content: [
              {
                type: "text",
                text: `Failed to get entity attribute: ${error.message}`,
              },
            ],
          };
        }
      }
    );
    
    // PowerPlatform entity relationships
    server.tool(
  • Supporting method in PowerPlatformService that performs the actual API request to fetch the specific entity attribute metadata.
    async getEntityAttribute(entityName: string, attributeName: string): Promise<any> {
      return this.makeRequest(`api/data/v9.2/EntityDefinitions(LogicalName='${entityName}')/Attributes(LogicalName='${attributeName}')`);
    }

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