QVeris — External API Code Generation
When a coding project needs to call external APIs or third-party tools (weather, stocks, search, currency, data retrieval, etc.), follow this workflow to discover a working API and generate production code.
Step 1 — Search & Verify via MCP
Use the QVeris MCP server to find and test tools.
- Search: Call the
search_toolsMCP tool with a query that describes the capability you need (not specific parameters).- Good query:
"current weather data","stock price API","currency exchange rates" - Bad query:
"get weather for London"(too specific)
- Good query:
- Test: Call
execute_toolwith thetool_idfrom search results and pass parameters viaparams_to_tool(JSON string). Refer to examples returned by search if available. - You may call multiple MCP tools in a single response. Iterate between
search_toolsandexecute_tooluntil you find a tool that works.
Step 2 — Generate Production Code
Once you have confirmed a working tool_id from Step 1, generate code that calls the QVeris REST API directly. Do not use the MCP tool results as the final output — generate real, standalone code.
Rules for generated code:
- Use the verified
tool_iddirectly (no search call needed in production code). - Set HTTP request timeout to 5 seconds.
- Handle error responses correctly (non-200 status,
success: false). - Place the
QVERIS_API_KEYin the code (read from environment variable or config).
QVeris REST API Reference
Base URL: https://qveris.ai/api/v1
Authentication: Bearer token in the Authorization header.
Authorization: Bearer YOUR_QVERIS_API_KEY
Execute Tool Endpoint:
POST /tools/execute?tool_id={tool_id}
Request body:
{
"search_id": "string",
"session_id": "string",
"parameters": {
"city": "London",
"units": "metric"
},
"max_response_size": 20480
}
Response (200 OK):
{
"execution_id": "string",
"result": {
"data": { ... }
},
"success": true,
"error_message": null,
"elapsed_time_ms": 847
}
Fallback — CLI Script (if MCP is unavailable)
If MCP tools are not available or not working, use the CLI script instead.
Search:
uv run {baseDir}/../scripts/qveris_tool.py search "weather forecast API" --limit 5
Execute (to verify a tool works):
uv run {baseDir}/../scripts/qveris_tool.py execute <tool_id> --search-id <id> --params '{"city": "London", "units": "metric"}'
After verifying a working tool via CLI, proceed to Step 2 above to generate production code using the REST API.