You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
default-value is applied over REST and ignored over MCP #124
An endpoint's default-value on a request field is applied when the parameter is absent over REST, and not over MCP. The same endpoint therefore behaves differently depending on which protocol called it.
REST — src/request_handler.cpp:
for (constauto& field : endpoint.request_fields) {
if (!field.defaultValue.empty() && params.find(field.fieldName) == params.end()) {
params[field.fieldName] = field.defaultValue;
}
}
MCP — src/mcp_tool_handler.cpp, prepareParameters, before this was removed:
for (constauto& field : endpoint_config.request_fields) {
if (field.defaultValue.empty() && params.find(field.fieldName) == params.end()) {
// No default and no provided value - could add validation here
}
}
Note the condition is inverted (defaultValue.empty()) and the body is empty. It applied nothing, while reading as though it applied defaults.
Consequence
A template written as
LIMIT {{ params.limit }}
with default-value: 100 renders LIMIT 100 over REST and LIMIT over MCP — a template error or an unbounded query, depending on the SQL. Any endpoint exposed as both a REST route and an MCP tool is affected.
Status
The empty loop has been deleted (it was provably a no-op, so removing it is behaviour-preserving) with a comment pointing here. Closing the divergence itself changes observable MCP behaviour, so it needs its own decision: apply defaults on the MCP path too — almost certainly what was intended — and accept that tools which currently receive no value will start receiving one.
Activity
chore: delete the abandoned config decomposition and the dead code it…
fix: address the crew review of this batch
fix: three open issues that were filed because they change behaviour (#…