Skip to main content
Glama

create_retention_query

Save a new retention query as a chart and optionally add it to a dashboard. Pass the exact spec you already ran successfully with run_retention_query — run it first so you know it works. Adding to a dashboard also requires permission to edit dashboards. The query is saved when this runs; explain it in reason. Load the manage-dashboards, retention-queries skills (load_skill("manage-dashboards"), load_skill("retention-queries")) first.

Input Schema

NameRequiredDescriptionDefault
nameYesShort chart title, e.g. 'Daily active players'. No time range.
specYesThe retention definition — exactly the spec you ran with run_retention_query.
reasonYesWhy you are making this change, in one sentence the user will read on the approval card.
projectIdYesThe project (application) id to scope this call to. Use list_projects to discover valid ids.
dashboardIdNoDashboard to add the new query to (appended at the end). Omit to save it unattached.
descriptionNoPlain-language description of what the chart measures: the events, the aggregation, and any filter, cohort, or breakdown that changes its meaning, in one or two sentences. No time range. Always write one, even when the user did not ask for it.
environmentYesThe environment name to scope this call to (e.g. 'production'). Use list_projects to discover the names available to this token.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false. The description adds real value beyond those: it discloses that the query is persisted immediately on invocation, that dashboard attachment requires edit-dashboard permission, and that it is a creation (hence non-idempotent) operation. It does not spell out what happens on duplicate names, which keeps it from a 5.

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?

Front-loaded with the core action, then the prerequisite, permission note, and skill-loading instruction in descending order of importance. Slightly dense with parenthetical function-call syntax, but no sentence is wasted.

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?

Given a deeply nested spec schema and no output schema, the description correctly offloads spec details to run_retention_query and the skills, and covers the critical preconditions. It stops short of describing what the created chart reference looks like, but the schema depth and sibling guidance compensate.

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 100%, so every parameter including name, description, reason, projectId, environment, and dashboardId is already documented in the schema. The description reinforces the spec-provenance constraint and the reason field but mostly restates what the schema says, so the baseline 3 applies.

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?

States a specific verb and resource ('Save a new retention query as a chart') plus the optional secondary effect (add to dashboard). An agent can distinguish it from run_retention_query and update_retention_query without inspecting either schema.

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

Usage Guidelines5/5

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

Explicit sequencing guidance: run run_retention_query first, pass that exact spec, and load the manage-dashboards and retention-queries skills before calling. It also names the permission precondition for the dashboard path, leaving little to inference.

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.

Resources