https://okai.cat/mcpRequest
Machine-facing input used by an AI or external system to submit a case to this OKAI instance.
OKAI SERVICE is an M2M interface.
The service receives requests generated by an external consumer.
The website's text interface is not part of the OKAI M2M contract; it is a human-facing surface for developing, inspecting and testing the service.
OKAI SERVICE és una interfície M2M.
El servei rep requests generats per un consumidor extern.
La interfície de text del web no forma part del contracte M2M d’OKAI; és una superfície humana de desenvolupament, inspecció i prova del servei.
An M2M Request is a complete and independent invocation of OKAI SERVICE.
The request carries a question through one of the two HTTP methods supported by /api/world.
Un M2M Request és una invocació completa i independent d’OKAI SERVICE.
El request transporta una question mitjançant un dels dos mètodes HTTP admesos per /api/world.
POST
POST carries question in a JSON request body:
POST transporta question dins d’un body JSON:
{
"question": "escoles de Granollers i biblioteques municipals"
} POST /api/world Content-Type: application/json
GET
GET carries question as a query parameter:
The question parameter must appear exactly once.
GET transporta question com a query parameter:
El paràmetre question ha d’aparèixer exactament una vegada.
GET /api/world?question=escoles%20de%20Granollers%20i%20biblioteques%20municipals
Both methods normalize question by trimming leading and trailing whitespace.
A valid GET or POST invocation executes the same World pipeline and returns the same response contract.
Els dos mètodes normalitzen question eliminant els espais inicials i finals.
Una invocació GET o POST vàlida executa el mateix pipeline de World i retorna el mateix contracte de resposta.
The request is NOT the question.
question is the input field carried by the request.
El request NO és la question.
question és el camp d’entrada transportat pel request.
Public endpoint:
https://okai.cat/api/world
Endpoint públic:
https://okai.cat/api/world
GET
curl -G "https://okai.cat/api/world" \ --data-urlencode "question=regidors"
POST
curl -X POST "https://okai.cat/api/world" \
-H "Content-Type: application/json" \
-d '{"question":"regidors"}'Streamable HTTP2026-07-28query_okaiThe MCP adapter receives a non-empty question through query_okai and transmits it
to the existing OKAI HTTP API.
MCP does not introduce a different knowledge model or conversational state. It provides another public interface to the same OKAI SERVICE.
MCP protocol negotiation and tool discovery operations do not generate an EXPEDIENT. Executing query_okai initiates one independent OKAI SERVICE request and therefore creates its own
EXPEDIENT.
L’adaptador MCP rep una question no buida mitjançant query_okai i la transmet a
l’API HTTP existent d’OKAI.
MCP no introdueix un model de coneixement diferent ni estat conversacional. Proporciona una altra interfície pública al mateix OKAI SERVICE.
Les operacions de negociació del protocol MCP i de descobriment d’eines no generen un EXPEDIENT. L’execució
de query_okai inicia un request independent d’OKAI SERVICE i, per tant, crea el seu propi
EXPEDIENT.
GET
GET returns HTTP 400 when:
questionis missing.questionappears more than once.questionis empty after normalization.
GET retorna HTTP 400 quan:
- Falta
question. questionapareix més d’una vegada.questionqueda buida després de normalitzar-la.
POST
POST returns HTTP 400 when:
- The request body is not valid JSON.
questionis missing or is not a string.questionis empty after normalization.
POST retorna HTTP 400 quan:
- El body del request no és JSON vàlid.
- Falta
questiono no és una cadena. questionqueda buida després de normalitzar-la.
Execution Failure / Error d’Execució
For either method, a World execution failure returns HTTP 500 with an error field.
Per qualsevol dels dos mètodes, una fallada d’execució de World retorna HTTP 500 amb un camp error.
M2M CONSUMER
│
│ REQUEST
│
├── GET /api/world?question=...
│
└── POST /api/world
{ "question": "..." }
▼
OKAI SERVICE
│
▼
resolveExpedient(question)
│
▼
EXPEDIENT Each M2M request initiates a new, independent EXPEDIENT.
OKAI SERVICE does not assume conversational continuity between requests.
resolveExpedient(question) executes Detection + Resolution exactly once on the received question.
The EXPEDIENT preserves the complete result of this execution:
Cada request M2M inicia un EXPEDIENT nou i independent.
OKAI SERVICE no assumeix continuïtat conversacional entre requests.
resolveExpedient(question) executa Detection + Resolution una única vegada sobre la question rebuda.
L’EXPEDIENT conserva el resultat complet d’aquesta execució:
questiondetectedEntitiesactiveTerritorialContextresolved_detectionsdetected_composition_membersonly_matched_text
Subsequent stages may construct different projections of the EXPEDIENT, but they do not execute Detection or Resolution again.
Les fases posteriors poden construir diferents projeccions de l’EXPEDIENT, però no tornen a executar Detection ni Resolution.
A single question may express multiple detectable realities or concepts.
Therefore, a single REQUEST may generate an EXPEDIENT containing multiple detections and resolved packages.
Una única question pot expressar múltiples realitats o conceptes detectables.
Per tant, un únic REQUEST pot generar un EXPEDIENT amb múltiples deteccions i resolved packages.
1 REQUEST
│
└── question
"escoles de Granollers i biblioteques municipals"
│ │
├── detection A └── detection B
│
▼
EXPEDIENT
[A, B] Do not interpret A and B as two requests.
They are detections/resolved packages belonging to the same EXPEDIENT originated by a single request.
No interpretar A i B com dos requests.
Són deteccions/resolved packages que pertanyen al mateix EXPEDIENT originat per un únic request.
1 REQUEST
↓
1 EXPEDIENT
↓
1..N DETECTIONS / RESOLVED PACKAGES
↓
DELIVERY
↓
1 OKAI MESSAGE This representation is conceptual and serves to distinguish the operational layers. It does not introduce behaviors that do not exist in the runtime.
Aquesta representació és conceptual i serveix per distingir les capes operatives. No afegeix comportaments que no existeixin al runtime.
HUMAN UI M2M
QueryForm External consumer
│ │
│ POST /api/world │ GET or POST /api/world
│ │
└───────────────┬──────────────┘
▼
OKAI SERVICE The M2M Request is part of the OKAI SERVICE contract.
The website's Human Input is a development, inspection and testing surface that allows a person to generate the same request.
It is not part of the M2M contract.
El M2M Request forma part del contracte d’OKAI SERVICE.
El Human Input del web és una superfície de desenvolupament, inspecció i prova que permet a una persona generar aquest mateix request.
No forma part del contracte M2M.
This section specifically describes how the content of the question field should be formulated.
Do NOT call the text contained in question a "request".
The question field may use compact natural language and direct nominal expressions, avoiding
conversational elements that do not contribute identifying knowledge.
Each question must be semantically self-contained within its request.
It must not depend on ellipses, anaphoric references or information contained in previous requests.
World detects explicit knowledge.
The M2M consumer must not expect OKAI to reconstruct, through inference, information that has not been
explicitly expressed in the question.
PREFER
- explicit natural language
- compact nominal expressions
- identifiable entities and concepts
- explicitly stated necessary context
- semantically self-contained questions
AVOID
- elliptical language
- anaphoric references
- dependence on previous requests
- unnecessary greetings and politeness
- introductions and justifications
- repetitions without identifying value
Aquesta secció parla específicament de com convé formular el contingut del camp question.
NO anomenis "request" al text contingut dins de question.
El camp question pot utilitzar llenguatge natural compacte i formes nominals directes,
evitant elements conversacionals que no aporten coneixement identificatiu.
Cada question ha de ser semànticament autosuficient dins del seu request.
No ha de dependre d’el·lipsis, referències conversacionals ni informació continguda en requests anteriors.
World detecta coneixement explícit.
El consumidor M2M no ha d’esperar que OKAI reconstrueixi per inferència informació que no ha estat
expressada a la question.
PREFERIR
- llenguatge natural explícit
- formes nominals compactes
- entitats i conceptes identificables
- context necessari explícit
- questions semànticament autosuficients
EVITAR
- llenguatge el·líptic
- referències anafòriques
- dependència de requests anteriors
- salutacions i cortesia innecessàries
- introduccions i justificacions
- repeticions sense valor identificatiu
HUMAN-ORIENTED QUESTION
"Could you tell me which schools there are in Granollers and which municipal libraries are available?"
M2M-ORIENTED QUESTION
"schools in Granollers and municipal libraries"
HUMAN-ORIENTED QUESTION
"Em podries dir quines escoles hi ha a Granollers i quines biblioteques municipals hi ha?"
M2M-ORIENTED QUESTION
"escoles de Granollers i biblioteques municipals"
The M2M formulation removes conversational language while preserving the necessary identifying elements.
This question may produce multiple detections within the same EXPEDIENT.
This does NOT mean that multiple requests have been executed.
La formulació M2M elimina llenguatge conversacional, però manté explícits els elements identificatius necessaris.
Aquesta question pot produir múltiples deteccions dins del mateix EXPEDIENT.
Això NO significa que s’hagin executat múltiples requests.
REQUEST A
{
"question": "escoles de Granollers i biblioteques municipals"
}REQUEST B
{
"question": "escoles de Granollers i biblioteques"
}A and B are two independent requests.
REQUEST B is not a continuation, abbreviation or contextual modification of REQUEST A.
Each request generates its own EXPEDIENT.
Each question is interpreted from the knowledge it explicitly expresses and the operational
context available to the OKAI instance.
A new request does not inherit the question, detections or EXPEDIENT of a previous request.
A i B són dos requests independents.
El REQUEST B no és una continuació, abreviació ni modificació contextual del REQUEST A.
Cada request genera el seu propi EXPEDIENT.
Cada question s’interpreta a partir del coneixement que expressa explícitament i del context
operatiu disponible per a la instància OKAI.
Un request nou no hereta la question, les deteccions ni l’EXPEDIENT d’un request anterior.
"Minimum conversational language, maximum explicit identifying knowledge."
"Mínim llenguatge conversacional, màxim coneixement identificatiu explícit."