Commit 209b2cd
Updated tool descriptions for aggregate_record tool. (#3310)
## Why make this change?
- Closes #3281
- The `aggregate_records` MCP tool descriptions were too abstract and
caused LLM confusion. The descriptions needed concrete examples,
prerequisite guidance, and error recovery instructions to improve LLM
accuracy when using the tool.
## What is this change?
Updates the `aggregate_records` tool metadata in
`AggregateRecordsTool.cs` to provide clearer, more actionable
descriptions:
| Property | Change |
|----------|--------|
| `description` | Full rewrite with prerequisites (call
`describe_entities` first), workflow examples, alias pattern
(`{function}_{field}`), and error recovery guidance |
| `field` | Changed `'*'` → `*` (removed quotes around asterisk) |
| `distinct` | Changed `'*'` → `*` (removed quotes around asterisk) |
| `filter` | Added unsupported string pattern operators note and example
without quotes |
| `groupby` | Added "includes the group fields and the aggregated value"
|
| `orderby` | Added example (`avg_unitPrice`), added "Cannot sort by
entity fields", removed default value (defaults cause LLMs to always
send orderby) |
| `having` | Added "Supported operators: eq, neq, gt, gte, lt, lte, in."
|
| `first` | Changed "paginated response" → "cursor pagination with
endCursor and hasNextPage" |
## How was this tested?
- [ ] Integration Tests
- [x] Unit Tests
- All 59 `AggregateRecordsTool` unit tests pass including description
validation tests
- [x] Manual Testing
- Verified descriptions render correctly in MCP Inspector at
`https://localhost:5001/mcp`
## Sample Request(s)
MCP Inspector tool listing shows the updated descriptions:
```
aggregate_records
Computes aggregations (count, avg, sum, min, max) on entity data.
Prerequisite: 1) Call describe_entities in the current session to discover valid entity names and field names.
2) Call this tool using only names returned by that call.
Do not use entity or field names from memory, prior conversations, or assumptions.
count supports field * to count all rows.
avg, sum, min, and max must reference a field with a numeric data type as returned by describe_entities.
...
```
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Souvik Ghosh <souvikofficial04@gmail.com>1 parent 75b8eec commit 209b2cd
1 file changed
Lines changed: 25 additions & 14 deletions
Lines changed: 25 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| |||
67 | 78 | | |
68 | 79 | | |
69 | 80 | | |
70 | | - | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
74 | | - | |
| 85 | + | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | | - | |
| 90 | + | |
80 | 91 | | |
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
85 | | - | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
91 | | - | |
| 102 | + | |
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
95 | | - | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
109 | 120 | | |
110 | 121 | | |
111 | 122 | | |
112 | | - | |
| 123 | + | |
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
| |||
0 commit comments