Skip to content

Commit 6b49f05

Browse files
committed
docs: enhance data fetching instructions for clarity and efficiency
1 parent e83e376 commit 6b49f05

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

custom/skills/analyze_data/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Then you need to select between two main tools for fetching data:
1010

1111
- Load and call `aggregate` tool to fetch data for analytics. This is the main tool for fast server-side aggregations, including filtered data, grouped metrics, and date buckets such as day, week, or month. Always prioritize this way of fetching data for analytics, as it is optimized for performance and reduces the amount of data transferred and processed in-memory.
1212

13-
- Load and call `get_resource_data` tool only when the requested analysis cannot be answered with `aggregate`. This is heavier because it returns original rows with all fields, but it allows complex calculations, comparisons, and custom groupings in-memory.
13+
- Load and call `get_resource_data` tool only when the requested analysis cannot be answered with `aggregate`. When using it, pass `columns` with only the fields required for the calculation so large result sets do not include unrelated row data.
1414

1515
# Instructions
1616

@@ -19,6 +19,7 @@ When the user asks for analytics, reports, trends, comparisons, or distributions
1919
- Fetch the requested data using `aggregate` whenever possible.
2020
- If it is not possible to get the required aggregates using `aggregate`, fetch the underlying rows with `get_resource_data`.
2121
- Prefer narrow requests: use filters, sorting, pagination, and date ranges whenever possible.
22+
- Prefer narrow row payloads: include `columns` when only one or a few fields are needed.
2223
- If the request is ambiguous, clarify the resource, metric, grouping, or date range before fetching data.
2324
- Return a short written summary with the key finding and most important numbers.
2425
- If the user asks for a chart, or if a chart would help and you decide to produce one, invoke the `charts` skill for chart formatting and Vega-Lite requirements.

custom/skills/fetch_data/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description: Fetch one or more records. Use to find records entities. To use thi
66

77
You can use tool `get_resource_data` it returns one or more records and is capable of using filters
88

9+
When you only need specific fields, pass `columns` with the exact resource column names you need. This keeps large result sets small. For record links or user-facing record choices, include the primary key and enough display fields, or omit `columns` when you need the full row context.
10+
911
# Instructions
1012

1113
To find specific data record you should use filters. ILIKE filters are preferred when we are unsure the input is clear.You can combine filters with OR if you want to search multiple fields.If user queries one record you should try to fetch up to 5 records and if more then one returned return output them all to user and ask to select one. When you communicate about record with user, show its several most important fields.

0 commit comments

Comments
 (0)