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' # defaultMechanics
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:
icontainsโ case-insensitive contains (default)istartswithโ case-insensitive prefixexactโ equality (use carefully, slow on text)
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