Skip to main content
Glama

Create a saved query

saved_queries_create

Save a Boolean query to run on a schedule and keep the posts it matches. Each run searches live, charges what its searches cost (never more than maxCreditsPerRun) and stores new matches; optionally sends them to a webhook endpoint. alertThreshold optionally alerts when it finds at least that many posts in an hour or a day (the saved_query.threshold webhook event); briefing optionally adds a daily or weekly briefing, in the app and to that endpoint; noise leaves out job ads, giveaways or crypto spam; platformSearches optionally sets what each run searches on a platform instead of what's planned from the query (every post is still checked against the whole query); sentiment optionally gives each new match a sentiment estimate, a paid extra out of each run's credits; insights (what the topic is about, and up to 3 yes/no questions) optionally judges each new match's relevance, kind, need of a reply and risk, 1 credit per 10 matches judged. Runs once straight away unless runNow is false. Check the query with query_validate_post first. Refused for a workspace that keeps no request content.

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": {
      "name": "<name>",
      "query": "<query>",
      "maxCreditsPerRun": "<maxCreditsPerRun>",
      "cadenceMinutes": "<cadenceMinutes>",
      "context": "<context>",
      "llm_model": "<llm_model>"
    },
    "name": "saved_queries_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesA name for the query, shown in the dashboard and in alerts.
briefNo
noiseNoKinds of post its runs leave out: `jobs` (job ads and job seekers' posts), `giveaways` (giveaway and contest entry posts), `crypto-spam` (crypto promotion and money scams). Checked on each post after it's found, so a run costs the same. Empty, the default, leaves everything in.
queryYesThe Boolean query. Check it for free first with POST /v1/query/validate.
runNowNoRun it once straight away rather than at its first scheduled time. Default true.
syntaxNoSyntax the query is written in: `native` (Social Fetch's Boolean language), or another tool's to import: `x` (X search), `onclusive`, `talkwalker`, `brandwatch` (also Cision Social Listening) or `meltwater`.
contextYesDescribe the user's underlying goal in one sentence, not the tool you are calling.
briefingNoA briefing on what it found: `daily` covers the day before (UTC) and comes at 08:00 UTC; `weekly` covers Monday to Sunday and comes on Monday at 08:00 UTC. It counts the posts, the change on the period before, the stories, each platform's posts, the loudest voices and the 5 most engaged posts, is shown on the query in the Listening app, and is sent to its webhook endpoint as the `saved_query.briefing` event. Only for an active query that ran in the period without failing. Null for none, the default.
insightsNo
llm_modelYesThe exact model identifier you (the assistant) are running as, taken from your system prompt or environment (for example "claude-opus-4-8" or "gpt-5.2"). Used for analytics only. If you do not know your model identifier with certainty, pass "unknown" and do not guess.
platformsNoPlatforms to search. Empty means every platform search covers.
sentimentNoGive each new match a sentiment estimate (positive, neutral or negative), for 1 credit per 10 matches given one, on top of each run's maxCreditsPerRun but within monthlyCreditCap when one is set. Only matches given one are charged. A match keeps its sentiment: it's never estimated or charged again. Default false.
alertThresholdNoA volume alert: when a run brings the posts it found in the trailing `window` to at least `posts`, it sends the `saved_query.threshold` webhook event, at most once a window. The first run of a query or of a new wording doesn't alert (it finds the backlog). Null for none.
cadenceMinutesYesMinutes between scheduled runs, from 15 to 10080 (a week).
conversation_idNoEcho the conversation_id from the server's previous response. The server provides it on the first call, never invent one, and do not issue parallel tool calls until you have it.
maxCreditsPerRunYesThe most one run may charge, held while it runs as with POST /v1/query/search; what isn't used is given back.
monthlyCreditCapNoThe most all its runs may charge in a calendar month (UTC). Null for no cap beyond each run's.
platformSearchesNo
webhookEndpointIdNoA webhook endpoint of this workspace to send new matches to (event `saved_query.matches`), spikes (event `saved_query.spike`: far more posts in 24 hours than its usual day), volume alerts (event `saved_query.threshold`) and briefings (event `saved_query.briefing`).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / brief
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "What a relevant match is, in your own words (up to 500 characters), such as \"People asking which project management tool to use for a small team. Not job ads or template sellers.\" Each run's new matches are judged against it by AI: relevant or not, with a short reason (`judgement` on each match). Free: a run judges up to 10 new matches for every credit it charges, and keeps any beyond that unjudged. Matches judged not relevant are still kept and returned; filter with `judgement`. A match keeps its judgement when the brief changes. Null or absent for none.",
      +      "maxLength": 500,
      +      "minLength": 10,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / platformSearches / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "description": "Searches each run makes on a platform instead of those planned from the query, by platform (`platformSearches` on `POST /v1/query/search`). Null for none: every platform searched as planned.",
      -    "properties": {
      -      "hackernews": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "instagram": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "linkedin": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "reddit": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "threads": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "tiktok": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "twitter": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "youtube": {
      -        "description": "Searches to run on this platform instead of those planned from the query, in its own syntax (Instagram: hashtags, with or without `#`). Posts found are still checked against the whole query.",
      -        "items": {
      -          "maxLength": 200,
      -          "minLength": 1,
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 1,
      -        "type": "array"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "description": "Searches each run makes on a platform instead of those planned from the query, by platform (`platformSearches` on `POST /v1/query/search`). Null for none: every platform searched as planned.",
      +    "properties": {
      +      "hackernews": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "instagram": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "linkedin": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "reddit": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "threads": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "tiktok": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "twitter": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "youtube": {
      +        "description": "Searches for this platform, in its own syntax (Instagram: hashtags).",
      +        "items": {
      +          "maxLength": 200,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "maxItems": 10,
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / platforms / items / description
      Previous value: -"A platform a search runs on: `twitter` (X), `reddit`, `youtube`, `tiktok`, `linkedin`, `instagram` (searched by hashtag, so only posts that use the hashtag are found), `threads` (searched by plain words, one short page a search, so it can miss posts) or `hackernews` (stories and comments). More platforms follow."New value: +"A platform to search: `twitter` (X), `reddit`, `youtube`, `tiktok`, `linkedin`, `instagram` (hashtags only), `threads` (one short page, so it can miss posts) or `hackernews`."
  3. Added

TDQS

A4.5/5.0
Behavior5/5

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

Goes far past the annotations by disclosing the charging model (maxCreditsPerRun held and refunded, sentiment at 1 credit per 10 matches, insights 1 per 10 judged, monthlyCreditCap interaction), what persists (matches and judgements survive; never re-judged or re-charged), alert suppression on the first run of a new wording, and workspace-type refusals. The annotations only say it is not read-only, not idempotent, and open-world; the description fills in the costly side effects an agent must know before calling.

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?

Purpose and cost model are front-loaded, and nearly every clause carries information about a distinct optional behavior. It is a dense single-paragraph wall of text, though, with several clauses that restate schema descriptions nearly verbatim (briefing, insights, platformSearches), so it is efficient rather than maximally tight.

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 19-parameter creation tool with no output schema, the description covers the behavioral surface an agent needs: cost ceilings, what gets stored, webhook events emitted, refusal conditions, and the validate-first workflow. The response shape is not described, but the description states that matches are stored and fanned out via webhook events, which is sufficient to call correctly.

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 already 84%, so the baseline is 3, but the description adds genuine meaning beyond the schema for the high-stakes parameters: the cost semantics of sentiment and insights, the alertThreshold window vs. cadenceMinutes constraint, briefing delivery times and events, and noise being evaluated post-fetch so cost is unchanged. Parameters such as name, syntax, context, llm_model and conversation_id are left to the schema, but those are low-ambiguity.

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?

Opens with a specific verb and resource — 'Save a Boolean query to run on a schedule and keep the posts it matches' — which cleanly separates it from the one-off query_search_post and from saved_queries_update. It also names query_validate_post as the prerequisite check, so the agent knows exactly what this tool produces.

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?

Gives a concrete precondition ('Check the query with query_validate_post first'), states the default immediate run ('Runs once straight away unless runNow is false'), and names a hard exclusion ('Refused for a workspace that keeps no request content'). It does not contrast with one-off search or with saved_queries_update, but the schedule-based framing implies the boundary well enough.

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.