Skip to main content
Glama

Search context

well_search_context
Read-only

Search the workspace's recorded notes and context (meeting notes, tickets, imported documents, and the caller's own imported emails) for a query. Returns compact snippets — each result's "snippets" is an array of one or more matched passages from that note. The best note results also carry "content", the note body (an email note starts with its From, To, Date and Subject lines), with "content_truncated" true when the body was cut — answer from "content" when it is there. Other note results have snippets only: follow up with well_get_entity on the returned note id for the full record. A result with source "memory_line" is one line of the workspace's memory: its snippet is the whole line, and it has no note to open. A result with entity_type "document" is a document: follow up with well_get_entity on root "documents" and its entity_id, and on root "notes" for each id in linked_note_ids to read the email it arrived in. A result with entity_type "message" is an email Well sent for the user: follow up with well_get_entity on root "messages" and its entity_id. To search only those sent emails by topic, pass entityType "message". Use this for questions about the business, a company, a person, a process, pricing, or a past decision. Do NOT use this for a question well_query_records already answers (amounts, counts, lists, filters). Do NOT use this for a contract's notice period (préavis), notice deadline, end date or renewal date: well_list_contract_terms reads those terms from the contracts on file, and a note is not where they are kept. An email result carries mail_direction: "sent" for a mail the caller wrote, "received" for a mail someone else wrote. An email result also carries person, the id of the single live person of the workspace holding the sender address, or null when no person or more than one holds it; never present a null person as a known person. To name that person, open it with well_get_entity on root "people" and its person_id, and never show the id itself as the person. A promise the caller made is in a sent mail; never present a received mail as the caller's own promise, and when mail_direction is null say the direction is not known. When a mail search returns missing_source "gmail", read the held mail notes first (root "notes", category "email"): they need no connection, so answer from them. Then say Gmail is not connected, give connect_url, and never offer to search again. Error "context_search_unavailable" with no missing_source means the search itself failed and a later try may work.

When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass workspace_id on the call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topKNo
queryYesFocused search query over the workspace's recorded notes, memory lines and context.
categoryNoPass "email" to search only the caller's own imported emails; the result then carries mail_scope.
entityIdNo
entityTypeNo
workspace_idNoTarget workspace. Omit when the token authorizes one workspace. Required when it authorizes several: this read reports one workspace's own figures and will not choose which.
occurredAfterNo
occurredBeforeNo
conversation_idNoThe conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.
workspace_scopeNoRestrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
resultsYes
successYes
mail_scopeNoPresent on a search with category "email": the mailboxes the search covered. own_mailboxes are the caller's own Gmail boxes, each with its state: not_enabled (Well does not read its mails), pending (reading is set up but not live yet), reading (Well is still reading its history, so its mails are not complete) or readable, with read_through, the date the box was last read. teammate_mailboxes is always an empty list: other people's boxes are never listed and their mails are private and never searched, so the empty list says nothing about whether a teammate connected Gmail. Null when the scope could not be read: then make no claim about the mailboxes.
connect_urlNoThe link that connects missing_source.
missing_sourceNoSet on a mail search when the caller has no own Gmail box: the source to connect.
total_returnedYes
conversation_idNoThe conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.
newly_connectedNoTools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.
resolved_workspaceNoThe workspace that answered, when the caller named none and the token authorizes several.
conversation_id_noteNoPresent only when the server opened a fresh lane, stating that no choice recorded earlier was read.
conversation_id_sourceNoWhere the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.
untrusted_content_noteNoPresent when a result is an imported email. Read it before the results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / results / items / properties / person
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "person_id": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "person_id"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "On an email result: the person behind the sender address, as {person_id}, when exactly one live person of the workspace holds it. Null when the address is unclaimed or shared, or the result is not an email."
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "source",
      -  "entity_type",
      -  "entity_id",
      -  "linked_note_ids",
      -  "note_id",
      -  "memory_line_id",
      -  "title",
      -  "snippets",
      -  "source_url",
      -  "occurred_at",
      -  "from_email",
      -  "sender_address",
      -  "mail_direction"
      -]New value: +[
      +  "source",
      +  "entity_type",
      +  "entity_id",
      +  "linked_note_ids",
      +  "note_id",
      +  "memory_line_id",
      +  "title",
      +  "snippets",
      +  "source_url",
      +  "occurred_at",
      +  "from_email",
      +  "sender_address",
      +  "mail_direction",
      +  "person"
      +]
  2. Changed2 schema fields changed
    • changedOutput schema / properties / mail_scope / description
      Previous value: -"Present on a search with category \"email\": the mailboxes the search covered. own_mailboxes are the caller's own Gmail boxes, each with its state: not_enabled (Well does not read its mails), pending (reading is set up but not live yet), reading (Well is still reading its history, so its mails are not complete) or readable, with read_through, the date the box was last read. teammate_mailboxes are other people's boxes, whose mails are private and never searched. Null when the scope could not be read: then make no claim about the mailboxes."New value: +"Present on a search with category \"email\": the mailboxes the search covered. own_mailboxes are the caller's own Gmail boxes, each with its state: not_enabled (Well does not read its mails), pending (reading is set up but not live yet), reading (Well is still reading its history, so its mails are not complete) or readable, with read_through, the date the box was last read. teammate_mailboxes is always an empty list: other people's boxes are never listed and their mails are private and never searched, so the empty list says nothing about whether a teammate connected Gmail. Null when the scope could not be read: then make no claim about the mailboxes."
    • changedOutput schema / properties / newly_connected / description
      Previous value: -"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."New value: +"Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later."
  3. Changed2 schema fields changed
    • addedOutput schema / properties / results / items / properties / content
      Added value: +{
      +  "description": "The note body, capped. Present on the best note results only.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / content_truncated
      Added value: +{
      +  "description": "True when content was cut at the cap; call well_get_entity for the full note.",
      +  "type": "boolean"
      +}
  4. Changed3 schema fields changed
    • addedOutput schema / properties / results / items / properties / mail_direction
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "sent",
      +        "received"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "On an email result: \"sent\" when the caller's own mailbox wrote it, \"received\" when another address did. Null when it is not known or the result is not an email."
      +}
    • addedOutput schema / properties / results / items / properties / sender_address
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "On an email result: the address that wrote the mail. Null when it is not known or the result is not an email."
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "source",
      -  "entity_type",
      -  "entity_id",
      -  "linked_note_ids",
      -  "note_id",
      -  "memory_line_id",
      -  "title",
      -  "snippets",
      -  "source_url",
      -  "occurred_at",
      -  "from_email"
      -]New value: +[
      +  "source",
      +  "entity_type",
      +  "entity_id",
      +  "linked_note_ids",
      +  "note_id",
      +  "memory_line_id",
      +  "title",
      +  "snippets",
      +  "source_url",
      +  "occurred_at",
      +  "from_email",
      +  "sender_address",
      +  "mail_direction"
      +]
  5. Changed2 schema fields changed
    • addedOutput schema / properties / connect_url
      Added value: +{
      +  "description": "The link that connects missing_source.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / missing_source
      Added value: +{
      +  "const": "gmail",
      +  "description": "Set on a mail search when the caller has no own Gmail box: the source to connect.",
      +  "type": "string"
      +}
  6. Changed6 schema fields changed
    • addedInput schema / properties / category / description
      Added value: +"Pass \"email\" to search only the caller's own imported emails; the result then carries mail_scope."
    • addedInput schema / properties / workspace_scope
      Added value: +{
      +  "description": "Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace.",
      +  "enum": [
      +    "family"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / mail_scope
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "own_mailboxes": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "read_through": {
      +                "anyOf": [
      +                  {
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              },
      +              "state": {
      +                "enum": [
      +                  "not_enabled",
      +                  "pending",
      +                  "reading",
      +                  "readable"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "state",
      +              "read_through"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "teammate_mailboxes": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "owner_name": {
      +                "anyOf": [
      +                  {
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              }
      +            },
      +            "required": [
      +              "owner_name"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "own_mailboxes",
      +        "teammate_mailboxes"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Present on a search with category \"email\": the mailboxes the search covered. own_mailboxes are the caller's own Gmail boxes, each with its state: not_enabled (Well does not read its mails), pending (reading is set up but not live yet), reading (Well is still reading its history, so its mails are not complete) or readable, with read_through, the date the box was last read. teammate_mailboxes are other people's boxes, whose mails are private and never searched. Null when the scope could not be read: then make no claim about the mailboxes."
      +}
    • addedOutput schema / properties / results / items / properties / from_email
      Added value: +{
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "source",
      -  "entity_type",
      -  "entity_id",
      -  "linked_note_ids",
      -  "note_id",
      -  "memory_line_id",
      -  "title",
      -  "snippets",
      -  "source_url",
      -  "occurred_at"
      -]New value: +[
      +  "source",
      +  "entity_type",
      +  "entity_id",
      +  "linked_note_ids",
      +  "note_id",
      +  "memory_line_id",
      +  "title",
      +  "snippets",
      +  "source_url",
      +  "occurred_at",
      +  "from_email"
      +]
    • addedOutput schema / properties / untrusted_content_note
      Added value: +{
      +  "description": "Present when a result is an imported email. Read it before the results.",
      +  "type": "string"
      +}
  7. Changed7 schema fields changed
    • changedInput schema / properties / entityType / enum
      Previous value: -[
      -  "note",
      -  "memory_line"
      -]New value: +[
      +  "note",
      +  "document",
      +  "message",
      +  "memory_line"
      +]
    • addedOutput schema / properties / newly_connected
      Added value: +{
      +  "description": "Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. Start the reply with one line per entry, in the person's language: \"<name> is connected.\". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "name": {
      +        "type": "string"
      +      },
      +      "service_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "name",
      +      "service_id"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / results / items / properties / entity_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / entity_type
      Added value: +{
      +  "enum": [
      +    "note",
      +    "document",
      +    "message",
      +    "memory_line"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / linked_note_ids
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / results / items / properties / source / enum
      Previous value: -[
      -  "note",
      -  "memory_line"
      -]New value: +[
      +  "note",
      +  "document",
      +  "message",
      +  "memory_line"
      +]
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "source",
      -  "note_id",
      -  "memory_line_id",
      -  "title",
      -  "snippets",
      -  "source_url",
      -  "occurred_at"
      -]New value: +[
      +  "source",
      +  "entity_type",
      +  "entity_id",
      +  "linked_note_ids",
      +  "note_id",
      +  "memory_line_id",
      +  "title",
      +  "snippets",
      +  "source_url",
      +  "occurred_at"
      +]
  8. Changed7 schema fields changed
    • changedInput schema / properties / entityType / enum
      Previous value: -[
      -  "note"
      -]New value: +[
      +  "note",
      +  "memory_line"
      +]
    • changedInput schema / properties / query / description
      Previous value: -"Focused search query over the workspace's recorded notes and context."New value: +"Focused search query over the workspace's recorded notes, memory lines and context."
    • addedOutput schema / properties / results / items / properties / memory_line_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / results / items / properties / note_id / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / results / items / properties / note_id / type
      Removed value: -"string"
    • addedOutput schema / properties / results / items / properties / source
      Added value: +{
      +  "enum": [
      +    "note",
      +    "memory_line"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "note_id",
      -  "title",
      -  "snippets",
      -  "source_url",
      -  "occurred_at"
      -]New value: +[
      +  "source",
      +  "note_id",
      +  "memory_line_id",
      +  "title",
      +  "snippets",
      +  "source_url",
      +  "occurred_at"
      +]
  9. Changed4 schema fields changed
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id
      Added value: +{
      +  "description": "The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id_note
      Added value: +{
      +  "description": "Present only when the server opened a fresh lane, stating that no choice recorded earlier was read.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / conversation_id_source
      Added value: +{
      +  "description": "Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened.",
      +  "enum": [
      +    "host_meta",
      +    "argument",
      +    "minted"
      +  ],
      +  "type": "string"
      +}
  10. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources