Search

Free-text search across the fields the resource opts into.

Usage

๐Ÿค– MCP โ€” tools/call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_user",
    "arguments": {"search": "john"}
  }
}

๐ŸŒ REST โ€” Querystring

GET /users?search=john

Resource declares which fields are searchable:

class UserResource(BaseResource):
    search_fields = ['email', 'name']
    search_operator = 'icontains'   # default

Mechanics

Internally the library expands the search query into:

Q(email__icontains='john') | Q(name__icontains='john') | Q(id__icontains='john')

id is always included so users can find rows by primary key.

Search operator

Override search_operator per resource:

Combining

Search composes with filters, ordering, and pagination โ€” same on both surfaces.

๐Ÿค– MCP โ€” tools/call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_user",
    "arguments": {
      "search": "john",
      "filter": {"active": true},
      "order_by": "-created_at"
    }
  }
}

๐ŸŒ REST โ€” Querystring

GET /users?search=john&active=true&order_by=-created_at

Applies search, then filter, then ordering, then paginates. All standard.

0-mcp by Stamatios Stamou Jr โ€” github.com/ssjunior/0-mcp