Skip to main content
Glama
rafteles2016

MCP Dynamics CRM Server

by rafteles2016

dynamics_get_entity_analytics

Analyze entity metrics like total records and usage to monitor performance and track data volume in Microsoft Dynamics CRM.

Instructions

Analisa métricas de uma entidade (total de registros, usage, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityLogicalNameYesNome lógico da entidade

Implementation Reference

  • Implementation of the 'dynamics_get_entity_analytics' tool, which fetches entity metadata, record count, recent plugin traces, and active workflows.
    server.tool(
      "dynamics_get_entity_analytics",
      "Analisa métricas de uma entidade (total de registros, usage, etc.)",
      GetEntityAnalyticsSchema.shape,
      async (params: z.infer<typeof GetEntityAnalyticsSchema>) => {
        // Get entity metadata
        const metadata = await client.get<Record<string, unknown>>(
          `EntityDefinitions(LogicalName='${params.entityLogicalName}')?$select=LogicalName,SchemaName,DisplayName,EntitySetName,IsCustomEntity,IsAuditEnabled,ChangeTrackingEnabled`
        );
    
        // Get record count
        const countResult = await client.get<number>(
          `${(metadata as Record<string, unknown>).EntitySetName}/$count`
        );
    
        // Get recent plugin trace logs for this entity
        const pluginTraces = await client.list("plugintracelogs", {
          select: ["typename", "messagename", "performanceexecutionduration", "exceptiondetails"],
          filter: `contains(primaryentity,'${params.entityLogicalName}')`,
          orderby: "createdon desc",
          top: 10,
        });
    
        // Get workflows related to this entity
        const workflows = await client.list("workflows", {
          select: ["name", "category", "statecode", "mode"],
          filter: `primaryentity eq '${params.entityLogicalName}' and statecode eq 1`,
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: `## Análise da Entidade: ${params.entityLogicalName}\n\n**Metadados:**\n- Schema: ${(metadata as Record<string, unknown>).SchemaName}\n- Custom: ${(metadata as Record<string, unknown>).IsCustomEntity}\n- Audit: ${JSON.stringify((metadata as Record<string, unknown>).IsAuditEnabled)}\n- Change Tracking: ${(metadata as Record<string, unknown>).ChangeTrackingEnabled}\n\n**Registros:** ${countResult}\n\n**Plugins Recentes (${pluginTraces.value.length}):**\n${JSON.stringify(pluginTraces.value, null, 2)}\n\n**Workflows Ativos (${workflows.value.length}):**\n${JSON.stringify(workflows.value, null, 2)}`,
            },
          ],
        };
      }
    );
  • Schema definition for 'dynamics_get_entity_analytics' requiring entityLogicalName.
    export const GetEntityAnalyticsSchema = z.object({
      entityLogicalName: z.string().describe("Nome lógico da entidade"),
    });
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. It mentions analyzing metrics but doesn't disclose behavioral traits such as whether this is a read-only operation, performance implications, rate limits, or authentication needs. This is a significant gap for a tool that likely queries system data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose. It is appropriately sized and front-loaded, with no wasted words, though it could be slightly more specific to improve clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what metrics are returned, the format of the output, or any behavioral context needed for effective use. For a tool that analyzes entity data, this leaves significant gaps in 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 description adds no meaning beyond the input schema, which has 100% coverage and clearly describes the single parameter 'entityLogicalName'. Since schema coverage is high, the baseline score is 3, as the schema adequately documents the parameter without needing additional explanation in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool analyzes metrics for an entity, specifying 'total de registros, usage, etc.' which gives a general purpose. However, it's somewhat vague about what specific metrics are included and doesn't clearly differentiate from sibling tools like 'dynamics_get_views' or 'dynamics_get_forms' that also retrieve entity-related information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., for monitoring or reporting), or exclusions, leaving the agent to infer usage from the name and description alone.

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/rafteles2016/mcpDynamics'

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