Skip to main content
Glama

Query Deals

query_deals
Read-only

Every result also carries the pipeline's stages (in order) and a pipeline_summary (open count and amount, closing this month, won/lost counts, win rate) for the whole pipeline — the summary ignores the filters. Dict with paging info, the stages, the pipeline summary, and the deals page. {total, has_more, stages: [{id, name, position}], pipeline_summary: {open_count, open_amount, closing_this_month {count, amount}, won_count, lost_count, win_rate}, deals: [{id, name, amount (decimal string or null), status, stage {id, name, position}, person_profile {id, name, title, email, linkedin_url, ...} or null, company_profile {id, name, domain} or null, assignee_email, expected_close_date, notes, created_at, stage_changed_at, closed_at (when it was won or lost; null while open), archived_at, open_task_count, next_task {id, title, due_at} or null, suggested_task, others_at_company {company {id, name}, count, other_open_deal} or null (how many other people at the deal's company have had outreach sent or are on a deal there, and whether another open deal sits there), data}]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoText match on the deal name, company name, or contact name.
limitNoMax deals (default 25, capped at 200).
stageNoOnly deals in this stage, by name (e.g. "Proposal") or id. Open deals sit in a stage; won/lost is the status, not a stage.
offsetNoDeals to skip for paging; re-call with offset += limit while has_more is true.
statusNo'open' (default), 'won', 'lost', or 'all'.open
person_idNoOnly deals linked to this person (a query_people `id`).
company_idNoOnly deals linked to this company (a query_companies `id`).
on_behalf_ofNoAn agency client's email, from list_agency_clients, to run this call in that client's account: their agents, settings, connected accounts, and credits. Omit it to act on your own account.
assignee_emailNoOnly deals owned by this teammate (an active teammate from list_teammates).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / on_behalf_of
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "An agency client's email, from list_agency_clients, to run this call in that client's account: their agents, settings, connected accounts, and credits. Omit it to act on your own account."
      +}
  2. Added

TDQS

A4.9/5.0
Behavior5/5

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

With only readOnlyHint available, the description carries real extra weight: it discloses that deals are team-shared, that ordering depends on status (manual board order vs newest-first), and the non-obvious caveat that pipeline_summary ignores the supplied filters. These are behavioral traits an agent could not derive from the annotations or schema.

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?

Front-loaded with the purpose and routing guidance, and the summary/returns structure keeps the long return-shape block skimmable. It is longer than strictly needed for a list tool and carries some UI trivia ('which the team sets by dragging cards'), though most length is justified since there is no output schema.

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?

No output schema exists, and the description compensates by enumerating the return dict down to nested fields, the stages array, and the pipeline_summary contents. Combined with ordering, sharing, and the filter-vs-summary caveat, an agent has everything required to call and interpret this tool.

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 coverage is 100%, so baseline is 3, but the description goes beyond the schema by explaining how status interacts with closed_at for 'won this month' queries, while the schema itself clarifies stage-vs-status ('won/lost is the status, not a stage') and the offset/has_more paging loop. Together they leave no parameter ambiguous.

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?

States a specific verb and resource ('List deals in the user's CRM pipeline') and immediately disambiguates it from siblings by noting it is the Deals view and is the lookup step before update_deal. The ordering semantics (open = board order stage-by-stage; won/lost/all = newest first) further pin down exactly which resource view an agent gets.

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?

Gives concrete usage phrases ('what's in my pipeline', 'does Jane have a deal', 'what did we win this month') plus the exact recipe for the last one (status='won', then compare closed_at), and routes the agent forward to update_deal once an id is found. Nothing about when to reach for this tool is left to inference.

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