Skip to content

MCP: list_recent_events filter parameter is silently ignored by the hub #77

Description

@DominikPinsel

Problem

The MCP tool list_recent_events advertises a filter parameter (subject filter pattern, e.g. forgejo.push, agent.olli.>) and forwards it as ?filter=... to the hub's /api/v1/queue/recent endpoint — but the hub handler (services/hub/internal/api/handlers_eventqueue.go, handleQueueRecent) only reads count and connector:

events, err := s.eventQueue.RecentEvents(r.Context(), count, connector, time.Time{})

The filter param is silently dropped, so callers always get all event types regardless of the filter. Combined with the oversized payloads (#75) this makes targeted queries impossible.

Proposed fix

Either:

  • make the hub's queue/recent handler understand a filter/subject-pattern parameter, or
  • map the MCP filter argument onto the existing connector parameter where applicable and remove/adjust the tool description so it doesn't advertise unsupported behavior.

Acceptance criteria

  • list_recent_events with filter returns only matching events, or the parameter is removed/renamed to match actual behavior
  • Tool description matches implemented semantics

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions