Frontmatter
| title | Polish endpoint helpers |
| author | Aki-07 |
| state | Merged |
| createdAt | Oct 12, 2025, 5:10 AM |
| updatedAt | Oct 13, 2025, 9:26 PM |
| closedAt | Oct 13, 2025, 9:26 PM |
| mergedAt | Oct 13, 2025, 9:26 PM |
| branches | dev ← feat/memory-mcp-endpoint-polish |
| url | https://github.com/neomjs/neo/pull/7466 |

There was sadly another ticket-spec hallucination in place. Details and next steps:
Hi @Aki-07,
First off, thank you so much for your contribution to Neo.mjs and for participating in Hacktoberfest! We truly appreciate you taking the time to work on this ticket.
I want to start with an apology. The ticket you worked on contained a suggestion to use a generic results property, which I wrote. After a deeper review with Tobi, we realized this suggestion contradicts our formal OpenAPI specification and that the spec actually defines a better, more descriptive API design. I am very sorry for this oversight on my part and for any confusion it caused.
Your pull request correctly implements the ticket as written, and we are very grateful for that. To get this PR merged and ensure you get that "hacktoberfest-accepted" tag, we'd like to ask for your help in making a few final adjustments to align with the official spec. This will ensure the long-term health and clarity of the project's API.
Here is a clear breakdown of the required steps:
Keep the Good Stuff:
- Your change to make the default limit and offset numeric (e.g., let {limit = 100, ...}) is perfect.
- Moving the allowedCategories array into the config.mjs file is also exactly right. Thank you for that!
Small Reversion (Stick with
parseInt):
- Could you please revert the change from Number(value) back to parseInt(value, 10) when parsing the limit and offset? parseInt is a bit more explicit and safer for this specific use case.
The Main Architectural Refinement (Aligning with the API Spec):
- This is the most important part. We need the service methods to be responsible for building the final JSON response object, as defined in our spec.
- In
ai/mcp/server/memory/services/summaries.mjs: The getSummaries() method should return an object like { count: number, total: number, summaries: [...] }. This will likely require a second database call to get the total count.- In
ai/mcp/server/memory/services/memories.mjs: Similarly, the getMemories() method should return { sessionId: string, count: number, total: number, memories: [...] }.- With these changes in the service files, the route handlers in routes/summaries.mjs and routes/memories.mjs will become beautifully simple, basically just const result = await service.getSummaries(...); res.json(result);.
We understand this is a bit more work than the original ticket asked for, and again, that is my fault. We are here to help you through it if you have any questions at all. These changes will make a fantastic contribution to the project.
As a final note for context, we will be moving the openapi.yaml file into the new ai/mcp/server/memory/ folder in a follow-up task to make it easier to find in the future.
Thank you again for your excellent work and your patience. We're looking forward to merging this!

Hey @tobiu thanks for the feedback, I have updated the changes in the same branch

Thx for your contribution, and adding the changes to it. Accepted.
✦ Excellent. I have analyzed the changes.
This is a fantastic turnaround by the contributor, @Aki-07. They have correctly interpreted the feedback and implemented the changes precisely as requested.
PR Review: Verification Checklist
Here is a breakdown of the review against your comment:
Keep Numeric Defaults: PASS. The diffs for both routes/memories.mjs and routes/summaries.mjs show the defaults for limit and offset are now numeric (e.g., limit = 100).
Keep
allowedCategoriesExternalized: PASS. The routes/summaries.mjs file now correctly sources the categories from req.app?.locals?.summaryCategories, which is the proper way to access app-level configuration.Revert to
parseInt: PASS. I can confirm from the diffs that the change from Number() back to parseInt(value,
- has been made.
Service Layer Builds the Response: PASS. This is the most critical part, and it's implemented perfectly.
- The service methods (getSummaries and getMemories) now perform the second database call to get the total count.
- They construct and return the full, spec-compliant JSON object ({ count, total, summaries: [...] } and { sessionId, count, total, memories: [...] }).
Simplified Route Handlers: PASS. As a direct result of the above change, the route handlers are now beautifully simple. They just call the service and pass the result to res.json(), with no complex logic.
Conclusion
The contributor has done an excellent job. They've not only implemented the requested changes but have demonstrated a good understanding of the desired architecture (separating concerns between routes and services). The code is now clean, maintainable, and correctly aligned with the project's OpenAPI specification.
This PR is ready to be merged. I will leave a final encouraging comment on the PR.
Please make sure to read the Contributing Guidelines:
https://github.com/neomjs/neo/blob/dev/CONTRIBUTING.md
What kind of change does this PR introduce? (check at least one)
Fixes #7464
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
devbranch, not themainbranchfix #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Summary