Skip to main content
Glama

describe_semantic_entity

Read-only

Retrieve the canonical definition and current state of a business entity such as Customer, Revenue, or Funnel to ensure accurate context before making decisions.

Instructions

Get the canonical definition and state of a business entity (Customer, Revenue, Funnel).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNo

Implementation Reference

  • The handler for the describe_semantic_entity tool. It loads the semanticLayer private module, calls describeSemanticSchema(), looks up the entity/metric by args.type, and returns the definition.
    case 'describe_semantic_entity': {
      const module = loadPrivateMcpModule('semanticLayer');
      if (!module) return unavailablePrivateMcpFeature('describe_semantic_entity');
      const schema = module.describeSemanticSchema();
      const entity = schema.entities[args.type] || schema.metrics[args.type];
      if (!entity) {
        throw new Error(`Unknown semantic entity: ${args.type}`);
      }
      return toTextResult(entity);
    }
  • Returns the SemanticSchema object containing all entity and metric definitions used by the handler.
    function describeSemanticSchema() {
      return SemanticSchema;
    }
    
    module.exports = {
      getBusinessMetrics,
      describeSemanticSchema,
      SemanticSchema,
  • The SemanticSchema defining entities (Customer, Revenue, Funnel, DataPipeline) and metrics (ConversionRate, BookedRevenue, etc.) queried by describe_semantic_entity.
    const SemanticSchema = {
      entities: {
        Customer: {
          description: 'An individual or organization using the gateway.',
          states: ['active', 'disabled'],
          tiers: ['free', 'pro', 'enterprise-sprint'],
        },
        Revenue: {
          description: 'Financial value captured by the system.',
          types: ['booked', 'reconciled', 'projected'],
        },
        Funnel: {
          description: 'The journey from anonymous visitor to paid customer.',
          stages: ['visitor', 'checkout_start', 'acquisition', 'paid'],
        },
        DataPipeline: {
          description: 'The staged analytics pipeline that materializes raw, staging, semantic, and lineage artifacts.',
          stages: ['raw', 'staging', 'semantic', 'lineage'],
        },
      },
      metrics: {
        ConversionRate: {
          description: 'The percentage of unique visitors who become paid customers.',
          calculation: 'paid_customers / unique_visitors',
        },
        BookedRevenue: {
          description: 'Total revenue documented in the system (Stripe + GitHub + Manual).',
          unit: 'cents',
        },
        ActiveProUsers: {
          description: 'Count of unique customers with at least one active Pro API key.',
        },
        AttributionCoverageRate: {
          description: 'The share of tracked web page views carrying attribution metadata.',
          unit: 'ratio',
        },
        UnreconciledPaidEvents: {
          description: 'Count of paid events still waiting for billing reconciliation.',
          unit: 'count',
        },
        PipelineWarnings: {
          description: 'Warning count emitted by the staged analytics reconciliation checks.',
          unit: 'count',
        },
        PredictedBookedRevenue: {
          description: 'Model-assisted projection of likely booked revenue from current funnel and attribution signals.',
          unit: 'cents',
        },
        IncrementalRevenueOpportunity: {
          description: 'Forecasted revenue left on the table relative to currently booked revenue.',
          unit: 'cents',
        },
        ProUpgradeScore: {
          description: '0-1 propensity score that free/local activity is ripe for Pro conversion.',
          unit: 'ratio',
        },
        TeamUpgradeScore: {
          description: '0-1 propensity score that current activity is ripe for Team rollout and expansion.',
          unit: 'ratio',
        },
        PredictiveAnomalyCount: {
          description: 'Count of predictive analytics anomalies requiring operator attention.',
          unit: 'count',
        },
      },
    };
  • Registration of semanticLayer as a private MCP module, mapping the key to the module path.
    const PRO_CHECKOUT_URL = 'https://thumbgate-production.up.railway.app/checkout/pro';
    const PRIVATE_MCP_MODULES = Object.freeze({
      intentRouter: path.resolve(__dirname, '../../scripts/intent-router.js'),
      delegationRuntime: path.resolve(__dirname, '../../scripts/delegation-runtime.js'),
      orgDashboard: path.resolve(__dirname, '../../scripts/org-dashboard.js'),
      reflectorAgent: path.resolve(__dirname, '../../scripts/reflector-agent.js'),
      swarmCoordinator: path.resolve(__dirname, '../../scripts/swarm-coordinator.js'),
      sessionReport: path.resolve(__dirname, '../../scripts/session-report.js'),
      operatorArtifacts: path.resolve(__dirname, '../../scripts/operator-artifacts.js'),
      managedLessonAgent: path.resolve(__dirname, '../../scripts/managed-lesson-agent.js'),
      semanticLayer: path.resolve(__dirname, '../../scripts/semantic-layer.js'),
      lessonInference: path.resolve(__dirname, '../../scripts/lesson-inference.js'),
      lessonSearch: path.resolve(__dirname, '../../scripts/lesson-search.js'),
    });
  • Alias: describe_reliability_entity is mapped to describe_semantic_entity.
    if (name === 'describe_reliability_entity') name = 'describe_semantic_entity';
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark it as readOnlyHint=true. The description adds that it returns 'canonical definition and state', which is useful but not detailed. It does not disclose any limitations, error conditions, or additional behavioral traits (e.g., authentication, rate limits).

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?

A single, well-structured sentence that front-loads the action 'Get' and the output 'canonical definition and state'. No unnecessary words, every part is informative.

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

Completeness4/5

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

For a simple read tool with one parameter and no output schema, the description covers the main purpose and possible inputs. It lacks details on output format or error handling, but is sufficient for the tool's simplicity.

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?

Schema coverage is 0%, so the description must compensate. It lists the enum values (Customer, Revenue, Funnel) but does not explain what each represents or how to choose. This adds minimal value beyond the schema's enum definition.

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

Purpose5/5

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

The description uses a specific verb 'Get' and resource 'canonical definition and state of a business entity', listing the exact entities (Customer, Revenue, Funnel). This clearly distinguishes it from the sibling 'describe_reliability_entity' which focuses on reliability entities.

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 context that the tool is for retrieving definitions of business entities, but does not explicitly state when not to use it or compare it to alternatives like describe_reliability_entity. It gives enough context to infer usage.

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/IgorGanapolsky/ThumbGate'

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