Skip to main content
Glama
Replaced by its MCP Registry listing

This endpoint is listed in the official MCP Registry as Segwise MCP. If you published it, claim ownership there.

Start Segwise Query

start_segwise_query
Destructive

Analyze the authenticated organization's advertising and creative performance or check its current generation token balance. Report that balance in generation tokens. Use this tool to compare performance and trends by app, campaign, ad network, creative, or creative tag and to analyze metrics including spend, impressions, clicks, installs, CTR, CVR, CPI, CPA, ROAS, revenue, and LTV. It can identify winning, declining, or fatigued creatives; explain which hooks, CTAs, visuals, themes, and formats drive results; and recommend what to scale, pause, refresh, or test next. It cannot modify campaigns. It creates a temporary background query job and may save conversation history. It returns a job_id immediately; call get_segwise_query with that exact job_id until the query reports completed or failed. Use operation=create_report or operation=update_report only when the user explicitly asks to save a new report or change an existing one. These operations persist changes in Segwise. Omit operation for analytics, including stored creative suggestions. If a write outcome is uncertain, inspect saved reports before starting another write. For custom AI tag creation, omit operation, app_names, and date_range. Show Chottu’s questions and results to the user. Pass the user’s actual replies unchanged with the same conversation_id, including confirmations and corrections. Wait for the user to confirm each step. For brand edits, omit operation and preserve the selected app scope. Show the full preview from get_segwise_query's result.answer, including its Markdown image links. If images cannot be rendered, present the links for review. For local files, copy the upload link exactly from the answer and wait for the user to attach the images. Proposals can import image files from shared Drive or Dropbox links. Wait for the user's explicit Save reply or revision and relay it unchanged with the same organization_id and conversation_id. Never generate a Save reply on the user's behalf. A confirmed save can replace or remove stored brand entries. For a selected local image or video use reference_upload only when the host can read the original bytes and make an HTTPS PUT. Poll for result.reference_upload, PUT the bytes with its exact headers and no MCP credentials, then pass its upload_id in reference_upload_ids on the plan request. Never put signed URLs in user-facing text. For static ads, users can browse their uploaded images. In video-enabled conversations they can also search and select their uploaded videos. Static generation requires conversation history and can spend the organization’s generation tokens after the user approves the plan. For static image generation, omit operation and use the same conversation_id and organization_id. Show the complete returned plan and estimated generation tokens, then wait for the user to confirm. Forward their actual reply unchanged; never supply confirmation yourself. A change requires a revised priced plan. After confirmation keep polling the same job and present each finished image link and any failures. For interrupted jobs ask for the existing static results in the same conversation. Never resend a confirmation to recover a result. For video requests omit operation, keep the same organization and conversation, and brainstorm with the user using their references. Show the complete written storyboard and both token estimates. Wait for their actual draft or full choice and forward it verbatim. For storyboard changes ask for a revision. For changes to a video made in this conversation show the edit and its estimate and wait for Apply edit. For a full-quality export, show the estimate and wait for the user’s export choice. Never supply a draft, full, export or Apply edit confirmation yourself. After submission, ask for video status in the same conversation until ready, then show the returned media link. Recover interrupted jobs by checking status. Never repeat a paid choice to retrieve a result. Queries can take several minutes and many status checks. A running status means the query is still executing, not that it failed or has no data. Keep calling get_segwise_query with the exact same job_id, respecting poll_after_seconds. Do not start a duplicate query or stop because repeated checks return running. Give brief progress updates while continuing to poll; do not finish with a still-running answer while polling remains available. Stop polling on completed, failed, execution_deadline, an unrecoverable error, or user cancellation. Retry transient status-check errors with bounded backoff and honor retry delays; do not retry authentication or permission failures. If the host prevents further execution, distinguish that interruption from query failure and preserve the job_id for resumption. organization_id is optional when exactly one organization is available; when multiple organizations are available, present only organization names to the user, map the chosen name to the corresponding organization_id, and retry without asking the user to read or type an ID. Use one Segwise conversation per user chat and organization. On the first question for an organization in a new chat, omit conversation_id and wait for start_segwise_query to return it before starting another query for that organization. For every later question in that chat, copy the exact conversation_id returned for that organization, even after a pause, a change of topic, or switching away from the organization and back. Recover the ID from earlier tool results when resuming a chat. A new user chat starts with no saved IDs. If the latest job in that conversation is running, set after_job_id to its job_id to queue the next question. Poll each question using its own job_id. When delegating, pass the conversation_id, organization_id and latest job_id to the agent and have it return the updated job_id. Route revisions and confirmations to the conversation containing the original proposal. Ask which proposal the user means if ambiguous. Set new_conversation=true and omit conversation_id only when the user requests a reset or Segwise reports missing or expired history.

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": {
      "question": "<question>"
    },
    "name": "start_segwise_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
questionYesA question about advertising analytics or the current generation token balance, a video concept, storyboard, draft/full choice, video edit, status, static ad plan or confirmation, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Forward the user’s actual confirmation verbatim after displaying the priced plan. Examples: Plan three static ads for my app.; Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?
app_namesNoOptional app names to restrict analysis, brand edits, or an ad generation plan. Omit for an organization-wide brand edit.
operationNoOmit or set analyze for analytics. Set create_report only to save a new report or update_report only to edit an existing report, when the user explicitly requests it.
date_rangeNoOptional inclusive date range.
after_job_idNoIf the latest job in this conversation is running, pass its job_id here with the same conversation_id to queue the next question. Omit when idle.
conversation_idNoOmit on the first start_segwise_query for this user chat and organization. Reuse the returned ID for every later question, including unrelated questions and delegated work. A new user chat starts fresh.
organization_idNoExact organization_id returned by list_segwise_organizations. Optional only when the authenticated user has exactly one eligible organization.
new_conversationNoSet true for a user-requested reset or to recover from a missing or expired history error. Omit conversation_id when true.
reference_uploadNoFor a host with access to the selected file and HTTPS PUT, request a short-lived upload ticket for one local image or video. Poll this job for result.reference_upload. Omit operation and reference_upload_ids.
reference_upload_idsNoUp to ten upload IDs selected by the user or returned by a successful file transfer. Attach these with the video or static plan request; preserve the conversation. Omit operation and reference_upload.

Output Schema

NameRequiredDescriptionDefault
job_idYesOpaque handle for this query. Pass it unchanged to get_segwise_query until the query reaches a terminal status.
statusYesRunning means the job is executing or waiting for its predecessor. Continue polling its own job_id.
messageYesGuidance for continuing this running query.
next_actionYesTool to call next with the same job_id.
conversation_idYesKeep this handle with the organization_id for every question in this user chat, including after a failed job. Pass both IDs to delegated agents.
organization_idYes
organization_nameYes
execution_deadlineYesLatest RFC3339 finish time. For a queued follow-up this includes its wait and execution budgets. Poll for its execution deadline once it starts.
poll_after_secondsYesMinimum delay in seconds before the next get_segwise_query call.
waiting_for_job_idNoPreceding job this follow-up is waiting for. Poll this follow-up using its own job_id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / question / description
      Previous value: -"An advertising analytics question, a video concept, storyboard, draft/full choice, video edit, status, static ad plan or confirmation, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Forward the user’s actual confirmation verbatim after displaying the priced plan. Examples: Plan three static ads for my app.; Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"New value: +"A question about advertising analytics or the current generation token balance, a video concept, storyboard, draft/full choice, video edit, status, static ad plan or confirmation, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Forward the user’s actual confirmation verbatim after displaying the priced plan. Examples: Plan three static ads for my app.; Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"
  2. Changed4 schema fields changed
    • changedInput schema / properties / after_job_id / description
      Previous value: -"To queue a follow-up behind its running task, pass that task’s latest job_id and conversation_id. Independent questions omit both fields."New value: +"If the latest job in this conversation is running, pass its job_id here with the same conversation_id to queue the next question. Omit when idle."
    • changedInput schema / properties / conversation_id / description
      Previous value: -"History for one task in this host chat and organization. Omit for each independent question. For a follow-up, pass the conversation_id of the task it refers to into start_segwise_query. Preserve it when delegating, revising or confirming."New value: +"Omit on the first start_segwise_query for this user chat and organization. Reuse the returned ID for every later question, including unrelated questions and delegated work. A new user chat starts fresh."
    • changedInput schema / properties / new_conversation / description
      Previous value: -"Set true only when the user explicitly requests a fresh Segwise conversation. A follow-up, changed date range, or new child agent or subprocess is not a reset. Omit conversation_id when true."New value: +"Set true for a user-requested reset or to recover from a missing or expired history error. Omit conversation_id when true."
    • changedOutput schema / properties / conversation_id / description
      Previous value: -"Keep this handle with this task and organization_id, including after a failed job. Pass it to agents handling follow-ups to this task."New value: +"Keep this handle with the organization_id for every question in this user chat, including after a failed job. Pass both IDs to delegated agents."
  3. Changed1 schema field changed
    • changedOutput schema / properties / execution_deadline / description
      Previous value: -"Absolute RFC3339 execution deadline for this query. Polling does not extend it. This is not the result retention deadline."New value: +"Latest RFC3339 finish time. For a queued follow-up this includes its wait and execution budgets. Poll for its execution deadline once it starts."
  4. Changed11 schema fields changed
    • addedInput schema / properties / after_job_id
      Added value: +{
      +  "description": "To queue a follow-up behind its running task, pass that task’s latest job_id and conversation_id. Independent questions omit both fields.",
      +  "type": "string"
      +}
    • changedInput schema / properties / app_names / description
      Previous value: -"Optional app names to restrict analysis, brand edits, or a static ad plan. Omit for an organization-wide brand edit."New value: +"Optional app names to restrict analysis, brand edits, or an ad generation plan. Omit for an organization-wide brand edit."
    • changedInput schema / properties / conversation_id / description
      Previous value: -"Conversation history handle for the original user's conversation and organization, including delegated work. Omit on the first query. For follow-ups copy the exact conversation_id from the parent or latest start or completed result into start_segwise_query, even after date range, app scope, or topic changes. Pass it and organization_id to any child agent or subprocess. If missing on a follow-up, recover it from the parent or prior results before calling. Never share handles between unrelated user conversations or organizations."New value: +"History for one task in this host chat and organization. Omit for each independent question. For a follow-up, pass the conversation_id of the task it refers to into start_segwise_query. Preserve it when delegating, revising or confirming."
    • changedInput schema / properties / question / description
      Previous value: -"An advertising analytics question, a static ad plan, revision or confirmation, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Forward the user’s actual confirmation verbatim after displaying the priced plan. Examples: Plan three static ads for my app.; Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"New value: +"An advertising analytics question, a video concept, storyboard, draft/full choice, video edit, status, static ad plan or confirmation, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Forward the user’s actual confirmation verbatim after displaying the priced plan. Examples: Plan three static ads for my app.; Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"
    • changedInput schema / properties / reference_upload / description
      Previous value: -"For a host with access to the selected file and HTTPS PUT, request a short-lived upload ticket for one local image. Poll this job for result.reference_upload. Omit operation and reference_upload_ids."New value: +"For a host with access to the selected file and HTTPS PUT, request a short-lived upload ticket for one local image or video. Poll this job for result.reference_upload. Omit operation and reference_upload_ids."
    • changedInput schema / properties / reference_upload / properties / content_type / description
      Previous value: -"image/png, image/jpeg, or image/webp."New value: +"PNG, JPEG, WebP, MP4, MOV or WebM MIME type."
    • changedInput schema / properties / reference_upload / properties / size_bytes / description
      Previous value: -"Exact file size in bytes, up to 50 MiB."New value: +"Exact file size in bytes. Images up to 50 MiB, videos up to 200 MiB."
    • changedInput schema / properties / reference_upload_ids / description
      Previous value: -"Up to ten upload IDs selected by the user or returned by a successful file transfer. Attach these with the static plan request; preserve the conversation. Omit operation and reference_upload."New value: +"Up to ten upload IDs selected by the user or returned by a successful file transfer. Attach these with the video or static plan request; preserve the conversation. Omit operation and reference_upload."
    • changedOutput schema / properties / conversation_id / description
      Previous value: -"Preserve this exact conversation handle for later queries in the original user's conversation and organization, including after a failed job. Pass it and organization_id unchanged between parent and child agents or subprocesses handling that conversation."New value: +"Keep this handle with this task and organization_id, including after a failed job. Pass it to agents handling follow-ups to this task."
    • changedOutput schema / properties / status / description
      Previous value: -"Running means execution is in progress. Continue polling the same job; it is not a failure or an empty result."New value: +"Running means the job is executing or waiting for its predecessor. Continue polling its own job_id."
    • addedOutput schema / properties / waiting_for_job_id
      Added value: +{
      +  "description": "Preceding job this follow-up is waiting for. Poll this follow-up using its own job_id.",
      +  "type": "string"
      +}
  5. Changed4 schema fields changed
    • changedInput schema / properties / app_names / description
      Previous value: -"Optional app names to restrict analysis or brand edits. Omit for an organization-wide brand edit."New value: +"Optional app names to restrict analysis, brand edits, or a static ad plan. Omit for an organization-wide brand edit."
    • changedInput schema / properties / question / description
      Previous value: -"An advertising analytics question, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Examples: Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"New value: +"An advertising analytics question, a static ad plan, revision or confirmation, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Forward the user’s actual confirmation verbatim after displaying the priced plan. Examples: Plan three static ads for my app.; Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"
    • addedInput schema / properties / reference_upload
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "For a host with access to the selected file and HTTPS PUT, request a short-lived upload ticket for one local image. Poll this job for result.reference_upload. Omit operation and reference_upload_ids.",
      +  "properties": {
      +    "content_type": {
      +      "description": "image/png, image/jpeg, or image/webp.",
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "description": "Filename including extension, without a path.",
      +      "type": "string"
      +    },
      +    "size_bytes": {
      +      "description": "Exact file size in bytes, up to 50 MiB.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "file_name",
      +    "content_type",
      +    "size_bytes"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
    • addedInput schema / properties / reference_upload_ids
      Added value: +{
      +  "description": "Up to ten upload IDs selected by the user or returned by a successful file transfer. Attach these with the static plan request; preserve the conversation. Omit operation and reference_upload.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  6. Changed2 schema fields changed
    • changedInput schema / properties / app_names / description
      Previous value: -"Optional app names to restrict the analysis."New value: +"Optional app names to restrict analysis or brand edits. Omit for an organization-wide brand edit."
    • changedInput schema / properties / question / description
      Previous value: -"An advertising analytics question or an explicit request to save or update a Segwise report. Examples: Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"New value: +"An advertising analytics question, a conversational custom tag or brand editing request, or an explicit request to save or update a Segwise report. Examples: Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"
  7. Changed2 schema fields changed
    • addedInput schema / properties / operation
      Added value: +{
      +  "description": "Omit or set analyze for analytics. Set create_report only to save a new report or update_report only to edit an existing report, when the user explicitly requests it.",
      +  "type": "string"
      +}
    • changedInput schema / properties / question / description
      Previous value: -"A read-only advertising or creative-performance question for Segwise. Examples: Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"New value: +"An advertising analytics question or an explicit request to save or update a Segwise report. Examples: Which hooks had the best ROAS on Meta last week?; Which creatives are showing fatigue?; Compare CPA and revenue across these apps.; What should we scale, pause, refresh, or test next?"
  8. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond annotations such as readOnlyHint=false, destructiveHint=true, openWorldHint=true, and idempotentHint=false, it discloses async job creation, token spend, persisted report and brand changes, upload ticket flow, polling behavior, and recovery rules. It also warns that a confirmed save can replace or remove stored brand entries, which matches destructiveHint. No contradiction with annotations is present.

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

Conciseness2/5

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

The description is a very long wall of workflow rules spanning analytics, reports, static ads, video, uploads, polling, and conversation management, with repeated warnings about confirmations and duplicate jobs. It is front-loaded only in the first few sentences; the rest is hard to scan and contains material that could be structured under headings or moved to related tools. It is complete but not concise.

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?

Given 10 parameters, a required question, 100% schema coverage, an output schema, and destructive/open-world annotations, the description covers the complex async workflow, polling, token spend, writes, and conversation state in detail. An agent has enough information to call it correctly and recover from common interruptions. The main weakness is organization, not missing context.

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 the schema already documents each parameter. The description still adds workflow meaning: operation omission rules, conversation_id reuse across questions, after_job_id queueing, organization_id name-to-ID mapping, new_conversation reset, and reference_upload/reference_upload_ids sequencing. The added value is real but embedded in a dense narrative rather than parameter-by-parameter structure.

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?

The opening states it analyzes advertising and creative performance or checks token balance, and later says it creates a temporary background query job returning job_id. It distinguishes itself from get_segwise_query by instructing the agent to poll that sibling with the returned job_id. However, it also folds report writes, static and video generation, brand edits, and uploads into the same entrypoint, so the core purpose is clear but unusually broad.

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 explicit conditions for operation=create_report or update_report versus omitting operation for analytics, and for reference_upload, after_job_id, conversation_id, organization_id, and new_conversation. It names get_segwise_query as the polling tool and describes when to stop polling and how to recover interrupted jobs. The guidance is exhaustive, though scattered across a long narrative.

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