Skip to main content
Glama

Run a saved query

run_query
Read-onlyIdempotent

Runs a saved OpenProject view and returns its work packages, preserving the team's stored filters, grouping, and sorting.

Instructions

Run a saved view and get its work packages — the fastest way to answer with a team's own definition of "the sprint" or "our bugs".

OpenProject queries run on read: this returns the rows as they are right now, in the stored order and grouping. The result is the standard list envelope — items of compact work-package rows, pagination, plus groups when the query groups and sums when it asks for totals — with one addition: query carries the stored definition (name, project, readable filters, group_by, sort_by), so the rows can be interpreted without a second call.

Pitfalls. groups and sums are computed server-side across the entire result set, not the page in front of you — never re-add them from items. Omitting page_size keeps the query's own page size, which may be much larger than 20. override_filters replaces the stored filters instead of narrowing them, and never edits the saved query. A 422 means the filter set is invalid for this query's context (a project-scoped filter on a global query, an unknown custom field); violations names the attribute.

Cross-references: find query ids with list_queries; equivalent ad-hoc filtering lives in list_work_packages; open a single row with get_work_package.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo1-based page number. Omit to use the page the stored query starts on (the first).
query_idYesSaved query id, from list_queries. It is the same id as in the UI's ?query_id= URL parameter.
page_sizeNoRows per page (max 100). Omit to keep the query's stored page size, which can be larger or smaller than this tool's usual default.
override_filtersNoRun the query with these filters instead of its stored ones, for this call only — e.g. [{'name': 'status', 'operator': 'o', 'values': []}] or [{'name': 'customField12', 'operator': '=', 'values': ['4']}]. This REPLACES the stored filters (the API cannot merge), so re-state anything you want to keep; 'query.filters' in the result shows what the stored ones were.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sumsNoPresent only when show_sums was requested.
itemsNoThe page of results.
notesNoDegradation markers: capped aggregations, unavailable modules, …
queryYesThe stored query definition, so the rows can be interpreted.
groupsNoPresent only when group_by was requested.
paginationYesTotal/page/page_size/has_more.
Behavior5/5

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

The description adds substantial behavioral detail beyond the annotations: it states queries run on read and return rows 'as they are right now', explains the standard list envelope plus the `query` addition, and details pitfalls such as `groups`/`sums` being server-side computed, `page_size` omission behavior, `override_filters` replacing stored filters, and the 422 error meaning. This contextualizes the readOnly/idempotent annotations without contradicting them.

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

Conciseness5/5

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

The description is efficiently structured: it leads with a purpose statement, then describes the result envelope, follows with a 'Pitfalls' paragraph highlighting key behavioral caveats, and ends with cross-references. Every sentence earns its place, and despite its length, there is no wasted text.

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 4-parameter tool with an output schema, this description is exceptionally complete. It covers the full result shape, server-side computation quirks, pagination behavior, error semantics, and the meaning of the `query` field in the response. It also provides cross-tool references, making it sufficient for an agent to use safely and effectively.

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?

The input schema itself has 100% coverage with detailed descriptions, so the baseline is 3. The description adds meaningful nuance beyond the schema: it clarifies that `override_filters` replaces stored filters rather than narrowing them, and that omitting `page_size` keeps the query's own stored page size. This supplemental guidance enhances but doesn't fully replace schema documentation.

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 opens with 'Run a saved view and get its work packages', which is a specific verb+resource pairing that clearly identifies the tool's function. It also distinguishes itself from siblings by cross-referencing 'list_work_packages' for ad-hoc filtering and 'get_work_package' for opening a single row, making the purpose unambiguous.

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?

The description explicitly provides usage guidance: it states the tool is the 'fastest way to answer with a team's own definition of the sprint or our bugs', and it names alternatives in the cross-references section ('find query ids with list_queries; equivalent ad-hoc filtering lives in list_work_packages; open a single row with get_work_package'). This gives clear when-to-use vs when-not-to-use context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kar-thik/openproject-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server