---
title: "Text search contexts"
method: GET
path: "/contexts/search"
tags: ["Context Sharing"]
---

# Text search contexts

`GET /contexts/search`

Search contexts by content, title, summary, or tags using MongoDB text search.

## Query parameters

- `q` string, required — Search query
- `limit` integer — Number of contexts to return
- `tags` string, nullable — Comma-separated tags to filter by
- `agent_source` string, nullable — Filter by agent source

## Response `200`

Successful Response

- ContextSearchResponse — Response for text search in contexts.
  - `contexts` object[] — Matching contexts
  - `search_query` string, required — The search query used
  - `total_results` integer — Total number of results

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/trynia/apis/nia-ai-api.md) · [All operations](https://skmtc.net/trynia/apis/nia-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trynia/nia-ai-api/versions/d216ffc3efb6/schema)
