Issue Type
Other: utility / response-structure improvement
Description
The project currently builds response payloads in different places using small one-off dictionaries. That works, but it makes response formatting harder to keep consistent. A small shared helper would make HTTP and MCP responses easier to shape in the same way, while keeping core logic separate from transport code.
Steps to Reproduce (for bugs)
- Review the HTTP and MCP response paths in the project
- Note that response payloads are built in small ad hoc dictionaries
- Observe that response formatting is more scattered than it needs to be
Expected behaviour
HTTP and MCP layers should be able to use one small shared helper for response formatting.
Actual behaviour
Response formatting is currently spread across different places, which makes reuse and consistency harder.
Screenshots
Not applicable.
Additional context
Proposed scope:
- Add a small shared helper for building response payloads
- Support two simple cases:
- success responses
- error responses
- Use it only at the transport boundary
- Keep current behavior the same unless a small consistency fix is needed
Out of scope:
- A full response framework
- Refactoring the whole codebase to use it at once
- Returning HTTP or MCP response objects from core logic
- Redesigning the API
Acceptance criteria:
- A shared response helper exists in the codebase
- HTTP and/or MCP response formatting can use that helper instead of one-off dictionaries
- Core logic stays transport-neutral
- Current outward behavior stays the same, or only changes in a small intentional way
Possible Solution
Create one small helper, such as build_success_response() and build_error_response(), and use it first in one or two transport-facing paths. Keep the helper simple: it should only shape output data, not contain business logic.
Your Environment (for bugs):
- Operating System: N/A
- Browser (if applicable): N/A
- Version of the software: current
main branch
Issue Type
Other: utility / response-structure improvement
Description
The project currently builds response payloads in different places using small one-off dictionaries. That works, but it makes response formatting harder to keep consistent. A small shared helper would make HTTP and MCP responses easier to shape in the same way, while keeping core logic separate from transport code.
Steps to Reproduce (for bugs)
Expected behaviour
HTTP and MCP layers should be able to use one small shared helper for response formatting.
Actual behaviour
Response formatting is currently spread across different places, which makes reuse and consistency harder.
Screenshots
Not applicable.
Additional context
Proposed scope:
Out of scope:
Acceptance criteria:
Possible Solution
Create one small helper, such as
build_success_response()andbuild_error_response(), and use it first in one or two transport-facing paths. Keep the helper simple: it should only shape output data, not contain business logic.Your Environment (for bugs):
mainbranch