Skip to main content
Glama

Draft a report spec from the user's request

draft_report_spec
Read-only

Draft a ready-to-publish report spec from the user's request — one call; it NEVER publishes.

The report is ALWAYS a hosted Porter report (this draft, then publish_report_spec), never an HTML page, an artifact or a file.

Call it first when the user asks for a report: intent (their words), accounts_used (account_id values from list_accounts) and sections: what they asked for, one line each — <kind>: <metrics> [by <dimensions>] [top N] [| title]. The draft holds THOSE nodes with the connector's real ids, in order: you only edit style and texts::

["kpis: clicks, impressions, ctr, position", "trend: clicks, impressions",
 "table: clicks, impressions by query top 20", "bars: clicks by page",
 "heatmap: sessions by hour, dayOfWeek", "page: Detail", "donut: sessions by device"]

Kinds: kpis, trend (two metrics: two axes; by month), table, bars, donut, funnel (a > b > c), gallery, page (a new tab) and any chart: heatmap, scatter, areas, lines, columns, stacked, waterfall, boxplot, calendar, radial. Names short or natural (clicks, clics, campaign); ratios (ctr, cpc, cpa) are derived. What does not resolve comes back in skipped with did_you_mean ids. Without sections Porter picks a report type (archetype; alternatives when it was a close call: call again with archetype=<it>), or a generic draft. Optional: date_range {start, end} (ISO days) or preset 7d|30d|90d, locale (BCP-47, e.g. es-CO: the labels' language), style: oscuro_campana (dark, mono labels), claro_minimal, editorial (serif) or corporativo (centered band).

Returns spec (a FREE LAYOUT styled once in theme.css, with short ids, that passes publish_report_spec's checks: edit it, never rewrite it), draft_id, name, skipped, fields (per connector, the ids in use and the best alternatives: no list_fields unless you need another), data_preview (the period's KPI totals and top values: no query_data before publishing; the audit's queries already run in the background) and slots ({logo: {path, value}}, a JSON Patch add for the client's logo). Then publish_report_spec(draft_id=…, patch=[…]): the draft keeps the spec, name and accounts, so the patch holds only your changes — never resend the spec.

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": {
      "intent": "<intent>",
      "accounts_used": "<accounts_used>"
    },
    "name": "draft_report_spec"
  }
}

Input Schema

NameRequiredDescriptionDefault
styleNo
intentYes
localeNo
presetNo
sectionsNo
archetypeNo
date_rangeNo
accounts_usedYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description reinforces rather than contradicts them ('it NEVER publishes'). Beyond that it discloses non-obvious behavior: unresolved sections come back in skipped with did_you_mean ids, Porter picks an archetype when sections is omitted, the draft retains spec/name/accounts so the later patch must contain only changes ('never resend the spec'), and the spec must be edited rather than rewritten.

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?

It is front-loaded with purpose and the 'call it first' directive before the dense mechanics, and nearly every sentence carries operational weight. The cost is density: nested parentheticals, a long inline example list, and heavy backtick markup make it harder to scan than it needs to be, so some tightening is possible without losing information.

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

Completeness5/5

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

For an 8-parameter, open-world drafting tool with a rich output schema, the description covers calling order, input grammar, fallback behavior, and how the returned spec/draft_id feed the next call. Even though an output schema exists, the extra explanation of skipped, fields, data_preview, and slots prevents unnecessary sibling calls (list_fields, query_data).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 8 parameters, so the description must carry the full burden and does: intent, accounts_used (account_id values from list_accounts), sections with an explicit grammar and a worked example array, archetype, date_range {start,end} as ISO days, preset as 7d|30d|90d, locale as BCP-47 with an example, and all four style values with their visual meaning.

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 first sentence gives a specific verb and resource ('Draft a ready-to-publish report spec from the user's request') plus an explicit scope boundary ('it NEVER publishes'). It also pre-empts the most likely misreading by stating the output is 'ALWAYS a hosted Porter report ... never an HTML page, an artifact or a file', which cleanly separates it from its sibling publish_report_spec.

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?

It states the triggering condition directly ('Call it first when the user asks for a report') and routes the agent away from alternatives: 'no list_fields unless you need another', 'no query_data before publishing', and the two-step sequence into publish_report_spec(draft_id=...). It even handles the follow-up branch (call again with archetype=<it> when alternatives is returned), so the when/when-not guidance is unusually complete.

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