Skip to content

feat(mcp): batch read tools per high-traffic vertical #111

Description

@dougborg

Problem

Real Front workflows often fetch multiple resources in sequence: "summarize the last 5 messages from each of these 3 conversations", "look up these 10 customer handles", "tag these 6 tickets". Each per-id round trip burns LLM context and API quota.

Sibling repo statuspro added batch read tools in PR #49 and saw meaningful reductions in tool-call count for multi-item workflows.

Solution

Add 2-3 batch read tools per high-traffic vertical. Initial set:

  • get_conversations_batch(ids: list[str]) - fetch up to N conversations in one call
  • get_messages_batch(ids: list[str]) - fetch up to N messages in one call
  • lookup_contacts_batch(handles: list[str]) - resolve handles to contacts in one call

Implementation:

  • Parallel fan-out via asyncio.gather (transport-layer rate limiting already handles concurrency safely)
  • Cap at a sensible per-call max (~25) to keep responses bounded
  • Return aggregated results with per-id error reporting (a single failed lookup must not sink the batch)

Files to change

  • frontapp_mcp_server/src/frontapp_mcp/tools/conversations.py
  • frontapp_mcp_server/src/frontapp_mcp/tools/messages.py
  • frontapp_mcp_server/src/frontapp_mcp/tools/contacts.py
  • frontapp_mcp_server/src/frontapp_mcp/resources/help.py
  • frontapp_mcp_server/tests/tools/

Acceptance criteria

  • All three batch tools implemented and registered
  • Each tool caps batch size and returns clear error per failed id
  • Tests cover happy path, max-size, and partial-failure
  • Help resource updated

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions