Skip to main content
Glama

Start Segwise Query

start_segwise_query

Analyze the authenticated organization's advertising and creative performance using Segwise's internal agent. 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 or generate creatives. 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. 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. Conversation continuity rule: this host chat means the original user's conversation, including work delegated to child agents or subprocesses. Omit conversation_id on the first query for an organization in that conversation. Otherwise, copy the exact conversation_id and organization_id from the latest start or completed result into every later start_segwise_query call for that organization. Follow-ups such as 'How about last month?' reuse those IDs even when the date range, app scope, or topic changes. When delegating, pass both IDs to the child agent or subprocess and require it to use them and return them unchanged with its answer. A new agent, subprocess, or tool invocation does not start a new user conversation. If a follow-up is missing its handle, recover it from the parent or previous tool results before starting the query. Never reuse a handle with another organization or unrelated user conversation. Set new_conversation=true only when the user explicitly requests a fresh conversation; omit conversation_id for that reset.

Input Schema

NameRequiredDescriptionDefault
questionYesA 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?
app_namesNoOptional app names to restrict the analysis.
date_rangeNoOptional inclusive date range.
conversation_idNoConversation 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.
organization_idNoExact organization_id returned by list_segwise_organizations. Optional only when the authenticated user has exactly one eligible organization.
new_conversationNoSet 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.

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 execution is in progress. Continue polling the same job; it is not a failure or an empty result.
messageYesGuidance for continuing this running query.
next_actionYesTool to call next with the same job_id.
conversation_idYesPreserve 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.
organization_idYes
organization_nameYes
execution_deadlineYesAbsolute RFC3339 execution deadline for this query. Polling does not extend it. This is not the result retention deadline.
poll_after_secondsYesMinimum delay in seconds before the next get_segwise_query call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations mark this readOnlyHint=false and idempotentHint=false; the description explains why — it creates a persistent background job and may save conversation history — so the agent understands the side effects. It adds operational behavior the annotations cannot convey: multi-minute latency, many running status checks, retry guidance for transient vs auth errors, and explicit warnings not to start duplicate queries or abandon while polling remains available.

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?

Content is front-loaded with purpose first and mechanics later, which is good, but the body is roughly 350 words with heavy repetition around polling ("Keep calling get_segwise_query with the exact same job_id," "Do not start a duplicate query," and the restatement about running status) and repeated continuity language already present in the schema. The volume is defensible for a long-running job tool but could be trimmed meaningfully 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?

Given a background-job tool with an output schema, no annotation coverage of async semantics, and a six-parameter surface, the description covers everything an agent needs: async lifecycle, terminal conditions, retry policy, delegation rules, and organization/conversation handle resolution. Nothing material to correct invocation appears to be missing.

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 baseline is 3; the description still adds meaning, notably the organization-name-to-ID resolution procedure ("present only organization names to the user, map the chosen name to the corresponding organization_id") and the cross-invocation continuity rules for conversation_id and organization_id. Some of this duplicates the schema parameter descriptions nearly verbatim, which slightly reduces the marginal value.

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 uses a specific verb and scope: "Analyze the authenticated organization's advertising and creative performance using Segwise's internal agent," and enumerates the dimensions (app, campaign, ad network, creative, tag) and metrics covered. It also explicitly names what it does not do ("cannot modify campaigns or generate creatives"), cleanly separating it from get_segwise_query, which it identifies as the polling counterpart.

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 explicitly routes the agent: use this to start analysis, then call get_segwise_query with the returned job_id until completed or failed, and stop only on the enumerated terminal states. It specifies organization_id selection behavior when multiple orgs exist and when to set new_conversation=true, and it names the excluded capability (no campaign mutation or creative generation).

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