Response Types
The florentine_ask tool response consits of the result of any combination of the following three steps:
- Aggregation Generation: The question is converted into a MongoDB aggregation query.
- Query Execution: The aggregation runs against the database using the connection string you provided.
- Answer Generation: The structured result is transformed into a natural language answer.
Option 1: Set the Response Types in the settings
The easiest way to set your desired response types is in the LLM settings in your account. Just select the response type(s) you want to have returned:

Option 2: Provide the Response Types as a parameter
Please note
This option only works when you integrated Florentine as a local MCP server.
You have two options to include a returnTypes array:
- As the
RETURN_TYPESenvvariable in your local MCP server setup config (possible in static and dynamic mode) - As the
returnTypesparameter to theflorentine_asktool (possible only in dynamic mode)
Provide as ENV variable
Provide the variable value as a stringified json array:
"env": {
"RETURN_TYPES": "[\"result\"]"
}Provide as tool parameter
Provide the variable value as a json array:
{
"returnTypes": ["result"]
}Please note
If you provide the Response Types as a parameter, it will override the Response Types configuration in your account settings.
Response Types Configuration
You can choose which of these steps you want returned by specifying a returnTypes array with any combination of:
returnTypes Value | Description | Expected Keys in Response |
|---|---|---|
"aggregation" | Returns the generated MongoDB aggregation pipeline, the database and collection used and a confidence score on a scale from 0 to 10 on how confident the AI is that the aggregation will answer the question correct. | confidence, database, collection, aggregation |
"result" | Returns the raw query results from the executed aggregation. | result |
"answer" | Returns a natural language response based on the results from the executed aggregation. | answer |
Example returning all three steps
Imagine a tabletennis collection that records the results of the matches of two players.
Asking the question Who won the last match? with these florentine_ask tool parameters:
{
"question": "Who won the last match?",
"returnTypes": ["aggregation", "result", "answer"]
}The response then looks like this:
{
"content": [
{ type: 'text',
text: '{
"database": "samples",
"collection": "tabletennis",
"aggregation": [
{ "$sort": { "year": -1, "matchInYear": -1 } },
{ "$limit": 1 },
{
"$project": {
"winner": {
"$cond": {
"if": { "$eq": ["$matchwinner", "home"] },
"then": "$players.home",
"else": "$players.away"
}
}
}
}
],
"result": [{ "_id": "67d352056d3ef0f2281524cf", "winner": "Frank" }],
"answer": "Frank won the last match. According to our records, he emerged as the winner, highlighting his strong performance in that game."
}'
}
],
"isError": false
}Please note
The API behind the MCP server only executes the steps neccessary, so i.e. if you only provide aggregation in the returnTypes, the aggregation is not executed and no natural language answer generated, which increases the response time.