Skip to content

feat: search should also match against server description field #1453

Description

@truecallerabreham

Problem

The ?search= parameter on /v0/servers only matches against server_name (via ILIKE substring match). It does not search the description field.

This was explicitly requested in #135 (now closed) but only the name-search portion was implemented.

Impact

AI agents and users searching for servers by what they do (e.g., "weather", "database", "GitHub integration") cannot find relevant servers unless they already know the exact server name. The description field — which contains the most useful discovery information — is completely ignored by search.

Current behavior

GET /v0/servers?search=weather

Returns only servers where server_name contains "weather". A server named io.github.example/data-tools with description "Weather data and forecasts" is not returned.

Expected behavior

Search should match against both server_name AND description fields, with name matches ranked first for relevance.

Proposed implementation

  1. Add SubstringDescription filter field to ServerFilter
  2. Add ILIKE condition on the description column in buildFilterConditions
  3. Update the API handler to pass the search term to both filters
  4. Name matches should appear before description matches (relevance ranking)

Files affected

  • internal/database/database.go — add SubstringDescription to ServerFilter
  • internal/database/postgres.go — add ILIKE condition for description in buildFilterConditions
  • internal/api/handlers/v0/servers.go — pass search term to both name and description filters
  • internal/api/handlers/v0/servers_test.go — add tests for description search
  • internal/database/postgres_test.go — add tests for description filter

Context

This is particularly important for AI-agent workflows where the agent searches by capability keywords rather than knowing server names in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions