Closedloop.ai
MCP Server

Search

Free-text and full-text search across documents, projects, and more

Overview

search looks up work by text when you do not already have a slug or a filter, for example "find the auth PRD". It runs in one of two modes, and the response shape depends on which one runs:

ModeWhen it runsWhat it searchesResponse
Basicq is plain text and none of mode, types, or cursor is givenDocuments by title, slug, type, and tag; projects by name, slug, and descriptiondocuments and projects arrays
UnifiedAny of mode, types, or cursor is given, or q contains an inline filter such as @owner or status:TODORanked full-text search across the entity types listed under typesOne ranked results array with snippets and a nextCursor

Scope: read. When a call fails, the tool returns an isError result whose text gives the error title, a description, and, when the API sent them, the error code, message, and timestamp.

Returned slug values are the preferred handles for follow-up calls such as get-document and get-project.


Tool: search Scope: read Underlying API: GET /search

NameTypeRequiredDescription
qstringYesSearch text, 2–200 characters. May contain inline filters (see Inline filters).
mode"fulltext" | "prefix"Nofulltext is phrase- and operator-aware full-text search. prefix is typeahead: it also matches a partly typed last word. Giving mode runs the unified search. When the unified search runs without mode, fulltext is sent.
typesarray of "document", "project", "agent_session", "comment", "pull_request", "branch", "agent_component", "loop"NoRestrict the unified search to these entity types. Omit for all types. Duplicates are collapsed. Giving types runs the unified search.
limitintegerNoUnified-search page size, 1–100. The server default is 25. Ignored by the basic search.
cursorstringNoThe nextCursor from a previous unified response, 1–2048 characters. Send it with the same q, mode, and types to get the next page. Giving cursor runs the unified search.

About types:

  • loop is accepted so older clients are not rejected, but it returns no results.
  • agent_session results appear only for organizations that have turned on transcript search.

Inline filters

q can carry structured filters alongside free text. Any of them sends the call to the unified search.

FilterMeaning
@handleOwner (assignee). Repeat for any of several owners.
type:kindEntity type, for example type:document. Repeat for any of several types. Combined with types when both are given.
status:VALUEStatus equals the value, for example status:TODO.
priority:VALUEPriority. Supports comparisons such as priority>=medium.
project:VALUEProject.
updated:...Last-updated time, for example updated>7d or the inclusive range updated:2026-07-01..2026-07-15.

Comparison operators are =, !=, >, <, >=, and <=. Words that are not filters are searched as free text. An unknown filter key, operator, or value is not ignored: the API rejects the query with a 400.

{
  "query": "checkout",
  "documentCount": 1,
  "projectCount": 1,
  "documents": [
    {
      "id": "0b9a8c7d-...",
      "title": "Checkout Redesign",
      "slug": "PRD-42",
      "type": "PRD",
      "status": "IN_REVIEW",
      "priority": "HIGH",
      "projectName": "Payments",
      "assignee": {
        "id": "a1b2c3d4-...",
        "email": "jane@example.com",
        "firstName": "Jane",
        "lastName": "Doe",
        "avatarUrl": null
      },
      "updatedAt": "2026-10-01T12:00:00.000Z",
      "webUrl": "https://app.closedloop.ai/acme/documents/PRD-42"
    }
  ],
  "projects": [
    {
      "id": "5e6f7a8b-...",
      "name": "Payments",
      "slug": "PRO-12",
      "status": "IN_PROGRESS",
      "priority": "MEDIUM",
      "teamName": "Platform",
      "teamId": "6f7a8b9c-...",
      "assignee": null,
      "updatedAt": "2026-09-30T08:00:00.000Z"
    }
  ]
}

The basic search returns up to 25 documents and up to 25 projects, most recently updated first. It has no pagination. assignee is null when nobody is assigned. A document's webUrl is null when the row has no slug or type to build it from. The org slug in webUrl is omitted when the server cannot confirm it for the current session, leaving an org-less path such as /documents/PRD-42 that the browser resolves against whichever organization the reader is signed into.

{
  "mode": "fulltext",
  "query": "checkout status:TODO",
  "resultCount": 1,
  "nextCursor": "eyJ...",
  "results": [
    {
      "entityType": "document",
      "entityId": "0b9a8c7d-...",
      "title": "Checkout Redesign",
      "snippet": "Checkout Redesign ... the checkout flow for returning customers",
      "rank": 0.42,
      "updatedAt": "2026-10-01T12:00:00.000Z",
      "webUrl": "https://app.closedloop.ai/acme/documents/PRD-42"
    }
  ]
}

snippet is a short excerpt of the matching text; for a query made only of filters it is the title. nextCursor is null when there are no more results. webUrl is null when no route can be built for the hit, and follows the same org-slug rule as the basic search.

Errors

  • q shorter than 2 or longer than 200 characters, a limit outside 1–100, or an unrecognized mode or types value is rejected by input validation.
  • A malformed inline filter: a 400 from the API.

Examples

search(q: "auth PRD")
search(q: "checkout", types: ["document"], limit: 50)
search(q: "@jane status:IN_PROGRESS")

On this page