Skip to main content
Glama

get-record

Retrieve a specific record from PowerPlatform/Dataverse by providing the entity name (plural) and record ID. Simplify data access and management in PowerPlatform MCP.

Instructions

Get a specific record by entity name (plural) and ID

Input Schema

NameRequiredDescriptionDefault
entityNamePluralYesThe plural name of the entity (e.g., 'accounts', 'contacts')
recordIdYesThe GUID of the record

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "entityNamePlural": { "description": "The plural name of the entity (e.g., 'accounts', 'contacts')", "type": "string" }, "recordId": { "description": "The GUID of the record", "type": "string" } }, "required": [ "entityNamePlural", "recordId" ], "type": "object" }

Implementation Reference

  • The inline asynchronous handler function for the 'get-record' tool. It retrieves the PowerPlatformService instance via getPowerPlatformService(), calls its getRecord method, formats the result as a pretty-printed JSON string, constructs a text content response, and handles errors by returning an error message.
    async ({ entityNamePlural, recordId }) => { try { // Get or initialize PowerPlatformService const service = getPowerPlatformService(); const record = await service.getRecord(entityNamePlural, recordId); // Format the record as a string for text display const recordStr = JSON.stringify(record, null, 2); return { content: [ { type: "text", text: `Record from '${entityNamePlural}' with ID '${recordId}':\n\n${recordStr}`, }, ], }; } catch (error: any) { console.error("Error getting record:", error); return { content: [ { type: "text", text: `Failed to get record: ${error.message}`, }, ], }; } }
  • Zod input schema for the tool, defining two required string parameters: entityNamePlural (plural entity set name like 'accounts') and recordId (GUID of the record).
    { entityNamePlural: z.string().describe("The plural name of the entity (e.g., 'accounts', 'contacts')"), recordId: z.string().describe("The GUID of the record"), },
  • src/index.ts:541-577 (registration)
    MCP server tool registration call: server.tool('get-record', description, schema, handler).
    server.tool( "get-record", "Get a specific record by entity name (plural) and ID", { entityNamePlural: z.string().describe("The plural name of the entity (e.g., 'accounts', 'contacts')"), recordId: z.string().describe("The GUID of the record"), }, async ({ entityNamePlural, recordId }) => { try { // Get or initialize PowerPlatformService const service = getPowerPlatformService(); const record = await service.getRecord(entityNamePlural, recordId); // Format the record as a string for text display const recordStr = JSON.stringify(record, null, 2); return { content: [ { type: "text", text: `Record from '${entityNamePlural}' with ID '${recordId}':\n\n${recordStr}`, }, ], }; } catch (error: any) { console.error("Error getting record:", error); return { content: [ { type: "text", text: `Failed to get record: ${error.message}`, }, ], }; } } );
  • Core implementation in PowerPlatformService.getRecord(): makes an authenticated HTTP GET request to the Web API endpoint `/api/data/v9.2/${entityNamePlural}(${recordId})` via this.makeRequest().
    async getRecord(entityNamePlural: string, recordId: string): Promise<any> { return this.makeRequest(`api/data/v9.2/${entityNamePlural}(${recordId})`); }

Other Tools

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

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