build_rag_prompt
ActiveTool of IA-QA — 130+ QA & Dev Tools for AI Agents
Assemble a complete RAG (Retrieval-Augmented Generation) prompt from retrieved context chunks and a user query. Handles token budgeting, citation numbering, system instruction injection, and source attribution.
Parameters schema
{
"type": "object",
"required": [
"query",
"chunks"
],
"properties": {
"query": {
"type": "string",
"description": "The user question to answer"
},
"chunks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string"
},
"score": {
"type": "number"
},
"source": {
"type": "string"
}
}
},
"description": "Retrieved context chunks with .text (required), .source (optional), .score (optional)"
},
"language": {
"type": "string",
"description": "Response language instruction (e.g. \"French\", \"Spanish\")"
},
"cite_sources": {
"type": "boolean",
"description": "Add [1], [2] citation numbers (default: true)"
},
"max_context_tokens": {
"type": "number",
"description": "Max tokens for context section (default: 2000)"
},
"system_instruction": {
"type": "string",
"description": "Custom system instruction (default: standard RAG grounding instruction)"
}
}
}No endpoints wrapped at confidence ≥ 0.70.
Parent server
IA-QA — 130+ QA & Dev Tools for AI Agents
https://github.com/jcjamet/ia-qa
1/7 registries