Skip to content

MCP: match flock names case-insensitively, like grades and the flock search #1228

Closed

Description

@mforce

Part of #789. Found in the MCP audit.

Problem

The same model-supplied name is matched three ways:

  • cluckwork_list_flocks nameContains:"barn a" finds "Barn A" (ILike, FlockRepository.cs:75).
  • grade:"large" matches "Large" (OrdinalIgnoreCase, DailyEntryTools.cs and StockTools.cs).
  • flock:"barn a" on cluckwork_list_daily_entries and cluckwork_record_daily_entry answers No flock you can see is named or numbered 'barn a'. because ListByNameAsync compares f.Name == name (FlockRepository.cs:130).

Models often lower-case names they copy from a person's message. The refusal uses the same wording as a Worker's scope refusal, so it reads like a permission problem.

A related inconsistency: CommerceTools.cs echoes an unknown status value back, while FlockTools.cs deliberately does not, for the reason REST gives (log-visible control characters). Pick one rule.

Fix

  • Compare lower(Name) in ListByNameAsync. The existing ambiguity refusal already covers two flocks that differ only in case.
  • Drop "exact" from the flock parameter descriptions.
  • Make the status echo consistent.

Acceptance

flock:"barn a" resolves "Barn A". Two flocks named "Barn A" and "barn a" give the ambiguity refusal.

Activity

  1. added this to the MCP server support milestone on Oct 11, 2026
  2. added
    sliceThin vertical work item
    area:apiAPI/endpoint layer
    severity:p3Defect: degraded or partial behaviour
    size:SHours to a day; few files, no migration
    epic-789MCP server support (#789)
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiAPI/endpoint layerepic-789MCP server support (#789)severity:p3Defect: degraded or partial behavioursize:SHours to a day; few files, no migrationsliceThin vertical work item

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions