Skip to content

Add entity count to list_entities response #4

@mgoldsborough

Description

@mgoldsborough

Summary

When using the MCP server, list_{plural} returns an array of entities but doesn't tell you the total count. Adding a wrapper response with count and entities fields would help agents understand the dataset size.

What to do

  1. In lib/src/nb_pathway/server.py, update the list_tool function
  2. Change the return type from list[dict] to dict with structure:
    {
      "count": 5,
      "entities": [...]
    }
  3. Do the same for search_tool
  4. Update tests in lib/tests/test_server.py

Acceptance criteria

  • list_{plural} returns {"count": N, "entities": [...]}
  • search_{plural} returns {"count": N, "entities": [...]}
  • Tests updated
  • make check passes
  • E2E tests still pass

Estimated time: ~1-2 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions