Skip to content

Commit 4582c20

Browse files
committed
chore(changeset): aggregate_records option order and fixed currency
Claude-Session: https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 26b1d2e commit 4582c20

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/mcp': patch
3+
---
4+
5+
feat(mcp): `aggregate_records` returns select groups in their declared option order and names the currency of a fixed-currency amount
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Two facts the MCP `aggregate_records` tool now reads from the object as the caller is served it, on both the HTTP and the stdio door:
11+
12+
- Groups keyed by a `select` or `radio` field come back in the order the field declares its options, instead of the order the driver returned them in. A value no option declares, such as a null, sorts last. When the call groups by several keys, the order is applied to the leading select keys. From the first key that is not a select field onward, the driver's order stays. The groups are sorted before the tool's row cap, so the groups the cap keeps are the first ones in declared order.
13+
- An amount column (`sum`, `avg`, `min` or `max`) over a field whose `currencyConfig` is `currencyMode: 'fixed'` is named in a new result member `currencies`, which maps the column's alias to its ISO 4217 code, e.g. `"currencies": { "total": "USD" }`. The member is present only when at least one column has a currency. `count`, `count_distinct`, non-currency fields and `dynamic`-mode amounts carry none. A `record`-mode amount is still answered only when it is grouped by its currency code field, so each group's code is already in its row.
14+
15+
A field the caller's served schema does not show is never ordered by its options or named. A host whose bridge cannot serve the definition answers exactly as before. Existing members (`rows`, `totalGroups`, `truncated`) are unchanged.

0 commit comments

Comments
 (0)