Commit 2f3c09f
committed
CKAN: improve GPT-4o tool chaining (next-step hints, suggested_resource_id, search_and_query)
GPT-4o struggles to extract a resource UUID from one tool result and pass
it to the next call. This patch makes the CKAN plugin friendlier to weaker
multi-step tool callers without changing existing tool semantics:
- Tool descriptions now end with explicit "Next step" guidance naming the
follow-up tool (ckan__query_data, ckan__get_dataset, etc.).
- Per-parameter descriptions spell out provenance ("the `id` field inside
the `resources` array returned by ckan__search_datasets").
- search_datasets / get_dataset formatted output leads with a NEXT STEP
block exposing suggested_resource_id and a literal suggested_call line.
- New composite tool ckan__search_and_query that chains search + query
server-side, eliminating the cross-call ID-passing problem entirely.
Tests: tool count 6 -> 7, three new cases for search_and_query happy path,
no-match, and dataset-with-no-resources. Full CKAN suite passes (32/32).1 parent f69bbc8 commit 2f3c09f
2 files changed
Lines changed: 576 additions & 56 deletions
0 commit comments