Skip to content

Commit ca32e25

Browse files
committed
fix: improve Gemini prompt with explicit tool selection rules
- Add CRITICAL RULES section to prompt - Explicitly map query types to correct tools - Rule 1: organizations queries → ckan_organization_list - Rule 2: dataset queries → ckan_package_search - Rule 3: tag queries → ckan_tag_list - Prevent using faceting on package_search for organizations
1 parent 17bd38f commit ca32e25

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

web-gui/public/index.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,19 +598,27 @@ <h1 class="serif text-4xl md:text-5xl mb-2 gradient-text">
598598
Available MCP tools:
599599
${toolList}
600600
601-
Choose the most appropriate tool and generate its arguments.
602-
Respond ONLY with JSON in this format:
601+
CRITICAL RULES FOR TOOL SELECTION:
602+
1. If user asks about ORGANIZATIONS (like "which organizations", "organizations with most datasets", "list organizations"):
603+
→ Use ckan_organization_list with all_fields=true and sort="package_count desc"
604+
605+
2. If user asks about DATASETS (like "find datasets about X", "datasets on topic Y"):
606+
→ Use ckan_package_search or ckan_find_relevant_datasets
607+
608+
3. If user asks about TAGS:
609+
→ Use ckan_tag_list
610+
611+
4. NEVER use ckan_package_search with faceting to get organizations - use ckan_organization_list instead!
612+
613+
Respond ONLY with JSON in this exact format:
603614
{
604615
"tool": "tool_name",
605616
"arguments": {
606617
"server_url": "CKAN_SERVER",
607-
...other params based on tool schema
618+
...other params
608619
}
609620
}
610621
611-
For dataset searches use ckan_package_search or ckan_find_relevant_datasets.
612-
For organization queries use ckan_organization_list, ckan_organization_show, or ckan_organization_search.
613-
For tags use ckan_tag_list.
614622
Always include server_url parameter.
615623
Use conversation context to refine queries.`;
616624

0 commit comments

Comments
 (0)