Skip to main content
Glama

draft_custom_dataset

Read-only

EVENT/NEWS FEEDS (filings, decks, earnings, news) — RESEARCH FIRST, then draft: 1) situate(event_types=[the feed's event types]) — or situate(question=<the user's words>) — then get_event_ontology(event_type=...) for each to learn where it persists (persisted_in); 2) agree definitions with the user before drafting — universe, window, and what any loose term means (e.g. the proxy for "the AI trade"); 3) ONE SCOPED explore_data_catalogue census of company_event_node for the universe and window (tickers, dates, a row limit in the wording); 4) draft a request naming the table and column for each field, e.g. title from earnings figures, body from eight_k_timeseries_analysis.summary, link sec_link, guid company_event_node.node_id, pub_date occurred_at, ticker symbol_metadata.exchange || ':' || symbol; 5) refine with previous_draft_id + feedback, asking for ONE candidate when variants don't matter. PLAIN DATA FEEDS ("daily close and 20-day volume for AAPL, MSFT") skip all this and draft directly.

RESEARCH REPORTS ARE IN EVERY FEED BY DEFAULT: the build adds a `research_url` column to every row with a `symbol` or `ticker` column — a fixed, signed, sign-in-free link that serves the research report PDF behind that item (rss/atom items show it as a "Research" link). Don't put report links or /get-cached-reports in the request or in a column; just keep a bare `symbol` (or `ticker`) column in the draft (a company_symbol / EXCHANGE:TICKER column alone gets no research link). That link is ONLY for the feed's readers (redistribution): never call it, build one, or offer it as a way to download a report — the user gets reports through get_latest_report, and Flexreport's daily files through download_dataset.

Drafts the user's OWN dataset — a table built from Flexreport data on a schedule and published as a file (parquet, csv, tsv, json, jsonl, xlsx, xml, or an rss/atom feed) behind a fixed link — from a plain-English description. Step 1 of 2: draft (and refine) here, then save_user_dataset schedules it. Use when the user wants a custom data feed or a recurring file of their own ("build me a daily file of...", "an RSS feed of...", "a JSON feed I can poll"); for Flexreport's published feeds use download_dataset, and for a one-off look at the data use explore_data_catalogue. This is THE tool for any request worded as a "datafeed" or "feed" — never substitute schedule_task, an emailed workflow or a one-off file. Every column comes from stored data, and that includes the summaries and analysis Flexreport already stores (deck, press-release and 8-K summaries, key figures, flags, recommendations, research views), so a feed with summary columns is still a dataset; only new written analysis generated fresh each run is a schedule_task workflow (a transform step).

Asynchronous: returns {draft_id, task_id, status: "PENDING"}. Poll task_id with
get_task_status until SUCCESS — a draft takes about 45 s-4 min (validation, planning, a
sample run, finalize). On SUCCESS `result` is:
  {draft_id, validation_status: "OK" | "REJECTED", reason?, suggested_alternative?,
   user_request,
   candidates: [{name, description, columns, row_count, sample_rows, query_token,
                 has_fixed_dates, suggested_date_mode}]}
REJECTED -> relay `reason` and `suggested_alternative`; don't retry blindly.

Show the user each candidate's description, columns, row_count and a few sample_rows
and let them pick one. NEVER show `query_token` — it is an opaque sealed query whose
only use is save_user_dataset — but keep the chosen candidate's for the save.
- Samples show datetime columns as dates only; the built file keeps the full
  timestamp, so never tell the user a timestamp is missing from a sample.
- Candidates can be near-identical: compare their descriptions, not just the samples.

Pass `target_format` when the user has named one (always for rss/atom). A candidate
with a column named `published_at` can't be saved (that name is reserved for the
build time): refine it with feedback asking to rename the column.

To refine, call again with the SAME `request`, previous_draft_id=<draft_id> and
`feedback`; ask for "ONE candidate" when the variants don't matter. Each round is a
new draft with its own draft_id. Ask before saving: name,
schedule, and (if not the suggestion) date mode.

Rate-limited to 20 drafts per hour per user. Requires auth (your MCP client attaches
the OAuth bearer automatically).

Input Schema

NameRequiredDescriptionDefault
requestYesThe dataset to build, in plain English — what rows, which columns, which names, what window (e.g. "daily close and 20-day average volume for AAPL, MSFT, NVDA over the last 3 months"). When refining, re-send the same request.
feedbackNoWhat to change about the previous draft, e.g. "add the 50-day average", "weekly instead of daily". Only with previous_draft_id.
sample_rowsNoRows of each candidate returned as a sample (at most 5).
target_formatNoThe format the user plans to save in. rss/atom make the planner shape one row per feed item (title, link, description, pub_date, guid), newest first. Omit when unknown.
previous_draft_idNodraft_id of an earlier draft to refine (with `feedback`); the planner sees that draft's queries.

Output Schema

NameRequiredDescriptionDefault
queueNoWorker queue the draft was routed to.
statusYesPENDING on dispatch.
task_idYesPoll this with get_task_status until SUCCESS (same value as draft_id).
draft_idYesThe draft's id: pass to save_user_dataset, or as previous_draft_id to refine it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / sample_rows / description
      Previous value: -"Rows of each candidate returned as a sample (the backend returns at most 5)."New value: +"Rows of each candidate returned as a sample (at most 5)."
    • changedInput schema / properties / sample_rows / maximum
      Previous value: -100New value: +5
  2. Changed2 schema fields changed
    • changedInput schema / properties / sample_rows / default
      Previous value: -25New value: +5
    • changedInput schema / properties / sample_rows / description
      Previous value: -"Rows of each candidate returned as a sample."New value: +"Rows of each candidate returned as a sample (the backend returns at most 5)."
  3. Changed1 schema field changed
    • addedInput schema / properties / target_format
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "parquet",
      +        "csv",
      +        "tsv",
      +        "json",
      +        "jsonl",
      +        "xlsx",
      +        "xml",
      +        "rss",
      +        "atom"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The format the user plans to save in. rss/atom make the planner shape one row per feed item (title, link, description, pub_date, guid), newest first. Omit when unknown.",
      +  "title": "Target Format"
      +}
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, so the description carries the real weight: it discloses asynchronous execution, a 45s–4min latency, the exact SUCCESS payload (validation_status, candidates, query_token), the REJECTED relay path, and a 20-drafts-per-hour rate limit with OAuth auth. It also flags two non-obvious traps — a `published_at` column blocks saving, and `query_token` must never be shown to the user.

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?

The numbered research-first protocol is well front-loaded and each step is actionable, but the description runs to roughly five blocks and repeats itself — 'ask for ONE candidate when variants don't matter' appears both in step 5 and again in the refine paragraph. The multi-sentence research_url digression, while behaviorally useful, sits awkwardly inside a tool definition rather than a linked doc.

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 a high-complexity async planner tool, nothing an agent needs is missing: trigger conditions, pre-work, async polling, full result contract, save handoff, refinement loop, and failure handling are all covered, even though an output schema exists and would have excused omitting the return shape.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3; the description goes beyond it by explaining when `target_format` must be supplied ('always for rss/atom') and what rss/atom does to planner shaping, and by insisting `request` be re-sent identically when refining with `previous_draft_id` + `feedback`. `sample_rows` is left entirely to the schema, which is fine.

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 states a specific verb and artifact: 'Drafts the user's OWN dataset — a table built from Flexreport data on a schedule and published as a file (parquet, csv, ... or an rss/atom feed) behind a fixed link.' It explicitly separates itself from siblings download_dataset, explore_data_catalogue, save_user_dataset and schedule_task, so an agent can route without opening any 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?

It gives concrete trigger phrases ('build me a daily file of...', 'an RSS feed of...') and a hard exclusion ('never substitute schedule_task, an emailed workflow or a one-off file'), plus a carve-out that plain data feeds skip the research-first protocol. The two-step lifecycle (draft here, save_user_dataset schedules it) and refine path (same request + previous_draft_id + feedback) are spelled out.

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