@mastra/mcp-docs-server 1.1.25 → 1.1.26-alpha.2
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.
|
@@ -52,6 +52,8 @@ When referencing an agent from your Mastra instance, use `mastra.getAgentById()`
|
|
|
52
52
|
|
|
53
53
|
Returns the full response after all tool calls and steps complete. The result includes `text`, `toolCalls`, `toolResults`, `steps`, and token `usage` statistics.
|
|
54
54
|
|
|
55
|
+
See the [`Agent.generate()` reference](https://mastra.ai/reference/agents/generate) for the response shape, including tool call and tool result payloads.
|
|
56
|
+
|
|
55
57
|
```ts
|
|
56
58
|
const agent = mastra.getAgentById('test-agent')
|
|
57
59
|
const response = await agent.generate('Help me organize my day')
|
|
@@ -62,6 +64,8 @@ console.log(response.text)
|
|
|
62
64
|
|
|
63
65
|
Returns a stream you can consume as tokens arrive. The result exposes `textStream` for incremental output and promises for `toolCalls`, `toolResults`, `steps`, and token `usage` that resolve when the stream finishes.
|
|
64
66
|
|
|
67
|
+
See the [`MastraModelOutput` reference](https://mastra.ai/reference/streaming/agents/MastraModelOutput) for the stream shape, including tool call and tool result payloads.
|
|
68
|
+
|
|
65
69
|
```ts
|
|
66
70
|
const agent = mastra.getAgentById('test-agent')
|
|
67
71
|
const stream = await agent.stream('Help me organize my day')
|
|
@@ -300,6 +300,34 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
300
300
|
|
|
301
301
|
**options.includeRawChunks** (`boolean`): Whether to include raw chunks in the stream output. Not available on all model providers.
|
|
302
302
|
|
|
303
|
+
## Response structure
|
|
304
|
+
|
|
305
|
+
`Agent.generate()` returns the final data collected during execution. `steps` is an array of step objects. The tool arrays in the result, including top-level `toolCalls` and `toolResults` and the nested `step.toolCalls` and `step.toolResults` arrays, use Mastra's chunk format.
|
|
306
|
+
|
|
307
|
+
That means tool data is wrapped in `payload`:
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
const response = await agent.generate('Check the weather in Lagos')
|
|
311
|
+
|
|
312
|
+
for (const toolCall of response.toolCalls) {
|
|
313
|
+
console.log(toolCall.type) // 'tool-call'
|
|
314
|
+
console.log(toolCall.runId)
|
|
315
|
+
console.log(toolCall.from)
|
|
316
|
+
console.log(toolCall.payload.toolName)
|
|
317
|
+
console.log(toolCall.payload.args)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
for (const step of response.steps) {
|
|
321
|
+
for (const toolResult of step.toolResults) {
|
|
322
|
+
console.log(toolResult.type) // 'tool-result'
|
|
323
|
+
console.log(toolResult.payload.toolName)
|
|
324
|
+
console.log(toolResult.payload.result)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
For the streaming version of the same chunk shape, see the [ChunkType reference](https://mastra.ai/reference/streaming/ChunkType).
|
|
330
|
+
|
|
303
331
|
## Returns
|
|
304
332
|
|
|
305
333
|
**result** (`Awaited<ReturnType<MastraModelOutput<Output>['getFullOutput']>>`): Returns the full output of the generation process including text, object (if structured output), tool calls, tool results, usage statistics, and step information.
|
|
@@ -308,13 +336,59 @@ const response = await agent.generate('Help me organize my day', {
|
|
|
308
336
|
|
|
309
337
|
**object** (`Output | undefined`): The structured output object if structuredOutput was provided, validated against the schema.
|
|
310
338
|
|
|
311
|
-
**toolCalls** (`
|
|
339
|
+
**toolCalls** (`ToolCallChunk[]`): Array of tool call chunks made during generation.
|
|
340
|
+
|
|
341
|
+
**toolCalls.type** (`'tool-call'`): Chunk type identifier.
|
|
342
|
+
|
|
343
|
+
**toolCalls.runId** (`string`): Execution run identifier.
|
|
344
|
+
|
|
345
|
+
**toolCalls.from** (`ChunkFrom`): Source of the chunk, such as AGENT or WORKFLOW.
|
|
346
|
+
|
|
347
|
+
**toolCalls.payload** (`ToolCallPayload`): Tool call data.
|
|
348
|
+
|
|
349
|
+
**toolCalls.payload.toolCallId** (`string`): Unique identifier for the tool call.
|
|
350
|
+
|
|
351
|
+
**toolCalls.payload.toolName** (`string`): Name of the tool that was called.
|
|
352
|
+
|
|
353
|
+
**toolCalls.payload.args** (`Record<string, unknown>`): Arguments passed to the tool.
|
|
354
|
+
|
|
355
|
+
**toolCalls.payload.providerExecuted** (`boolean`): Whether the model provider executed the tool directly.
|
|
312
356
|
|
|
313
|
-
**toolResults** (`
|
|
357
|
+
**toolResults** (`ToolResultChunk[]`): Array of tool result chunks from tool executions.
|
|
358
|
+
|
|
359
|
+
**toolResults.type** (`'tool-result'`): Chunk type identifier.
|
|
360
|
+
|
|
361
|
+
**toolResults.runId** (`string`): Execution run identifier.
|
|
362
|
+
|
|
363
|
+
**toolResults.from** (`ChunkFrom`): Source of the chunk, such as AGENT or WORKFLOW.
|
|
364
|
+
|
|
365
|
+
**toolResults.payload** (`ToolResultPayload`): Tool result data.
|
|
366
|
+
|
|
367
|
+
**toolResults.payload.toolCallId** (`string`): Unique identifier for the tool call.
|
|
368
|
+
|
|
369
|
+
**toolResults.payload.toolName** (`string`): Name of the tool that produced the result.
|
|
370
|
+
|
|
371
|
+
**toolResults.payload.result** (`unknown`): Value returned by the tool.
|
|
372
|
+
|
|
373
|
+
**toolResults.payload.isError** (`boolean`): Whether the tool execution failed.
|
|
314
374
|
|
|
315
375
|
**usage** (`TokenUsage`): Token usage statistics for the generation.
|
|
316
376
|
|
|
317
|
-
**steps** (`
|
|
377
|
+
**steps** (`object[]`): Array of execution steps, useful for debugging multi-step generations.
|
|
378
|
+
|
|
379
|
+
**steps.text** (`string`): Text generated in this step.
|
|
380
|
+
|
|
381
|
+
**steps.toolCalls** (`ToolCallChunk[]`): Tool calls emitted during this step.
|
|
382
|
+
|
|
383
|
+
**steps.toolResults** (`ToolResultChunk[]`): Tool results emitted during this step.
|
|
384
|
+
|
|
385
|
+
**steps.finishReason** (`string`): Why this step finished.
|
|
386
|
+
|
|
387
|
+
**steps.usage** (`LanguageModelUsage`): Token usage for this step.
|
|
388
|
+
|
|
389
|
+
**steps.request** (`{ body?: unknown }`): Request metadata for this step.
|
|
390
|
+
|
|
391
|
+
**steps.response** (`object`): Response metadata for this step.
|
|
318
392
|
|
|
319
393
|
**finishReason** (`string`): The reason generation finished. Values include 'stop' (normal completion), 'tool-calls' (ended with tool calls), 'suspended' (waiting for tool approval), or 'error' (error occurred).
|
|
320
394
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.26-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`7020c06`](https://github.com/mastra-ai/mastra/commit/7020c0690b199d9da337f0e805f16948e557922e), [`7020c06`](https://github.com/mastra-ai/mastra/commit/7020c0690b199d9da337f0e805f16948e557922e)]:
|
|
8
|
+
- @mastra/mcp@1.5.1-alpha.0
|
|
9
|
+
- @mastra/core@1.25.1-alpha.1
|
|
10
|
+
|
|
11
|
+
## 1.1.26-alpha.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`d63ffdb`](https://github.com/mastra-ai/mastra/commit/d63ffdbb2c11e76fe5ea45faab44bc15460f010c)]:
|
|
16
|
+
- @mastra/core@1.25.1-alpha.0
|
|
17
|
+
|
|
3
18
|
## 1.1.25
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.26-alpha.2",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@mastra/core": "1.25.
|
|
33
|
-
"@mastra/mcp": "^1.5.0"
|
|
32
|
+
"@mastra/core": "1.25.1-alpha.1",
|
|
33
|
+
"@mastra/mcp": "^1.5.1-alpha.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@hono/node-server": "^1.19.11",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "4.0.18",
|
|
49
|
-
"@mastra/core": "1.25.0",
|
|
50
49
|
"@internal/lint": "0.0.83",
|
|
51
|
-
"@internal/types-builder": "0.0.58"
|
|
50
|
+
"@internal/types-builder": "0.0.58",
|
|
51
|
+
"@mastra/core": "1.25.1-alpha.1"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|