@mastra/mcp-docs-server 1.3.4-alpha.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -775,11 +775,39 @@ The standalone `ObservationalMemory` class accepts all the same options as the `
775
775
 
776
776
  When `retrieval` is truthy, Mastra registers a `recall` tool that pages through raw messages behind observation group ranges. With the default resource scope, the tool can list threads (`mode: "threads"`) and browse another thread through `threadId`. It also supports cross-thread search. Set `retrieval: { vector: true }` for semantic search (`mode: "search"`), or use `scope: 'thread'` to restrict the tool to the current thread. The tool is automatically added to the agent.
777
777
 
778
- Mastra also injects scope-aware usage instructions into the agent's context. For resource scope with `vector: true`, these cover routing between `search`, `threads`, and `messages`, including fallback to thread discovery when search results are unsuitable. Without `vector: true`, the instructions only cover `threads` and `messages` browsing, so the agent isn't steered toward a search mode that isn't configured. Resource-scoped instructions are injected even before any observation group exists, so the agent can browse other threads from the first message. Use `retrieval: { instructions: '...' }` to append application-specific guidance after the built-in instructions.
778
+ When retrieval is enabled, OM also injects instructions telling the agent how to use recall: when to verify details, how to search and page, and when to read raw messages. They're included from the first turn, including read-only runs, and only describe the modes that are configured. Reflected groups are marked `_kind: reflection_` so the agent treats them as lossy summaries. Use `retrieval: { instructions: '...' }` to append your own guidance after the built-in instructions.
779
+
780
+ ### Observation pages
781
+
782
+ With vector search configured, `mode: "observations"` reads the original observation groups around a search hit, including groups that reflection condensed away and buffered groups that haven't been activated yet. Copy the hit's `groupId` exactly as shown and, in resource scope, its `threadId`:
783
+
784
+ ```json
785
+ {
786
+ "mode": "observations",
787
+ "threadId": "source-thread-id",
788
+ "groupId": "group-id-from-search",
789
+ "direction": "after",
790
+ "limit": 5
791
+ }
792
+ ```
793
+
794
+ Use `direction: "before"` to page backward, or omit `direction` to include the anchor group itself. Pages return `{ results, count, hasMore }` with continuation calls, and say when newer messages haven't been observed yet.
795
+
796
+ ### Search results
797
+
798
+ Search results are listed by date and share a 2,000-token text allowance, so long groups are shortened, starting at the line that best matches the query. Results already in the agent's context come back as short references, and lower-ranked hits fill the freed space. `limit` counts excerpts, not references, so `count` can exceed `limit`.
799
+
800
+ ### Storage requirements
801
+
802
+ Group IDs in search results include the record that holds them (`groupId@recordId`), so paging reads a single record. Groups indexed before this change still work, but page by scanning the thread's observation history. Paging needs a storage adapter that supports observation history filters, so upgrade it together with `@mastra/memory`. Convex users need to redeploy their Mastra server functions.
779
803
 
780
804
  ### Parameters
781
805
 
782
- **mode** (`'messages' | 'threads' | 'search'`): What to retrieve. "messages" (default) pages through message history. "threads" lists all threads for the current user. "search" finds messages by semantic similarity across all threads (requires vector store and embedder). (Default: `'messages'`)
806
+ **mode** (`'messages' | 'threads' | 'search' | 'observations'`): What to retrieve. "messages" (default) pages through message history. "threads" lists threads for the current user. "search" finds messages by semantic similarity (requires vector store and embedder). "observations" pages original observation groups around a search hit. (Default: `'messages'`)
807
+
808
+ **groupId** (`string`): Required for observations mode. Copy the observation group ID exactly from a search result or continuation call. IDs shown as groupId\@recordId let paging read the record directly; a plain group ID also works.
809
+
810
+ **direction** (`'before' | 'after'`): For observations mode: return groups strictly before or after the anchor group. Omit to include the anchor and following groups.
783
811
 
784
812
  **query** (`string`): Search query for mode: "search". Finds messages semantically similar to this text across all threads for the current user.
785
813
 
@@ -791,7 +819,7 @@ Mastra also injects scope-aware usage instructions into the agent's context. For
791
819
 
792
820
  **page** (`number`): Pagination offset. For messages: positive values page forward from cursor, negative values page backward. For threads: page number (0-indexed). 0 is treated as 1 for messages. (Default: `1`)
793
821
 
794
- **limit** (`number`): Maximum number of items to return per page. (Default: `20`)
822
+ **limit** (`number`): Page size, from 1 to 20. Defaults to 20 for messages and 5 groups for observations. Search defaults to 10 excerpts, plus compact references for evidence already in context. Bounded backfill can return fewer excerpts. (Default: `20`)
795
823
 
796
824
  **detail** (`'low' | 'high'`): Controls how much content is shown per message part. 'low' shows truncated text and tool names with positional indices (\[p0], \[p1]). 'high' shows full content including tool arguments and results, clamped to one part per call with continuation hints. Image and file parts show their filename, media type, and stored URL or provider file ID so the agent can reuse the attachment. Inline file data such as base64 or data URIs is omitted. Pass viewAttachment with cursor and partIndex to send inline attachment data to the model. (Default: `'low'`)
797
825
 
@@ -805,9 +833,9 @@ Mastra also injects scope-aware usage instructions into the agent's context. For
805
833
 
806
834
  **viewAttachment** (`boolean`): Show the attachment itself rather than only describing it. Requires cursor and partIndex, and applies when that part is an image or file. Inline data such as base64 or data URIs is sent as a native media part. Attachments stored as remote URLs or provider file IDs, media types outside image/\* and application/pdf, and oversized payloads come back as an explanation instead. (Default: `false`)
807
835
 
808
- **before** (`string`): For mode: "threads" only. Filter to threads created before this date. Accepts ISO 8601 format (e.g. "2026-03-15", "2026-03-10T00:00:00Z").
836
+ **before** (`string`): Filter to threads created before this date in threads mode, or observations dated before it in search mode. Accepts ISO 8601 format (e.g. "2026-03-15", "2026-03-10T00:00:00Z").
809
837
 
810
- **after** (`string`): For mode: "threads" only. Filter to threads created after this date. Accepts ISO 8601 format (e.g. "2026-03-01", "2026-03-10T00:00:00Z").
838
+ **after** (`string`): Filter to threads created after this date in threads mode, or observations dated after it in search mode. Accepts ISO 8601 format (e.g. "2026-03-01", "2026-03-10T00:00:00Z").
811
839
 
812
840
  ### Returns (messages mode)
813
841
 
@@ -849,9 +877,9 @@ Mastra also injects scope-aware usage instructions into the agent's context. For
849
877
 
850
878
  ### Returns (search mode)
851
879
 
852
- **results** (`string`): Formatted search results grouped by thread. Each result shows the thread title, thread ID, relevance score, message preview, and a cursor ID for browsing into that thread.
880
+ **results** (`string`): Search hits displayed by observation date, with excerpts or compact references for evidence already in context. Full entries include thread details, a relevance score, an observation group ID, and source message ranges.
853
881
 
854
- **count** (`number`): Number of matching messages found.
882
+ **count** (`number`): Number of displayed observation groups, including compact references. Can exceed limit when search fills covered hits with additional excerpts.
855
883
 
856
884
  ### ModelByInputTokens
857
885
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.4-alpha.2",
3
+ "version": "1.3.4",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,8 +26,8 @@
26
26
  "@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
27
27
  "local-pkg": "^1.1.2",
28
28
  "zod": "^4.6.4",
29
- "@mastra/mcp": "^2.1.2",
30
- "@mastra/core": "1.73.1-alpha.1"
29
+ "@mastra/core": "1.74.0",
30
+ "@mastra/mcp": "^2.1.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hono/node-server": "^2.0.0",
@@ -43,9 +43,9 @@
43
43
  "tsx": "^4.23.1",
44
44
  "typescript": "^7.0.2",
45
45
  "vitest": "4.1.11",
46
- "@mastra/core": "1.73.1-alpha.1",
47
- "@internal/lint": "0.0.139",
48
- "@internal/types-builder": "0.0.114"
46
+ "@internal/lint": "0.0.140",
47
+ "@internal/types-builder": "0.0.115",
48
+ "@mastra/core": "1.74.0"
49
49
  },
50
50
  "homepage": "https://mastra.ai",
51
51
  "repository": {