Skip to main content
Glama

calculate_engagement

Read-onlyIdempotent

CAPABILITY: read. Calculate engagement rates for supplied post metrics. This read-only, deterministic operation performs no mutation or network request. Returns {perPost: [{interactions, denominator, basis, rate}], medianRate, aggregateRate, totalInteractions, totalDenominator}; rates are percentages. Returns {error: "invalid_input"} when a post is malformed or bases differ. CAPABILITY: read: side-effect-free.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "posts": "<posts>"
    },
    "name": "calculate_engagement"
  }
}

Input Schema

NameRequiredDescriptionDefault
postsYesPost metrics to score. Every post in one call must use the same basis.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / posts / description
      Added value: +"Post metrics to score. Every post in one call must use the same basis."
    • addedInput schema / properties / posts / items / properties / basis / description
      Added value: +"What the denominator counts. Use the same value for every post so rates are comparable."
    • addedInput schema / properties / posts / items / properties / comments / description
      Added value: +"Comment or reply count for the post."
    • addedInput schema / properties / posts / items / properties / denominator / description
      Added value: +"The audience number the rate is measured against: follower count, impressions or reach, as selected by basis."
    • addedInput schema / properties / posts / items / properties / likes / description
      Added value: +"Like or reaction count for the post."
    • addedInput schema / properties / posts / items / properties / saves / description
      Added value: +"Save or bookmark count for the post."
    • addedInput schema / properties / posts / items / properties / shares / description
      Added value: +"Share, repost or retweet count for the post."
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, non-destructive, and closed-world, so the repeated 'read-only, deterministic... no mutation or network request' adds little. The genuinely additive parts are the disclosed return keys (perPost with interactions/denominator/basis/rate, medianRate, aggregateRate, totals), the note that rates are percentages, and the 'invalid_input' error path.

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

Conciseness3/5

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

Return shape and error behavior are front-loaded, which is good, but the definition is padded with duplicated capability framing ('CAPABILITY: `read`' twice plus 'side-effect-free') restating what annotations already declare.

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?

With one fully-described parameter and no output schema, the description supplies the essential return structure and error case, so an agent can call it and interpret results. A brief note on rounding or zero-denominator handling would close the remaining gap.

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 description coverage is 100% and the schema already documents basis, denominator, and the same-basis-per-call constraint. The description only restates the mixed-basis failure mode, adding no syntax, default, or format detail beyond the schema.

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

Purpose4/5

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

States a specific verb and resource: 'Calculate engagement rates for supplied post metrics.' The phrase 'supplied post metrics' signals this is a computation over caller-provided data rather than a retrieval, which distinguishes it in spirit from siblings like get_engagement_summary or get_engagement_by_tag, though none are named explicitly.

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

Usage Guidelines3/5

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

Usage is only implied: the agent can infer this is the tool for turning raw metric numbers into rates. There is no explicit when-to-use/when-not-to-use guidance and no direction toward get_engagement_by_tag or get_engagement_summary for fetching or aggregating data.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.