@mastra/mcp-docs-server 0.13.30-alpha.0 → 0.13.30-alpha.1
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.
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +15 -0
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Freact.md +13 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +8 -8
- package/.docs/organized/changelogs/create-mastra.md +19 -19
- package/.docs/organized/changelogs/mastra.md +27 -27
- package/.docs/organized/code-examples/agent.md +0 -1
- package/.docs/organized/code-examples/agui.md +2 -2
- package/.docs/organized/code-examples/client-side-tools.md +2 -2
- package/.docs/raw/agents/adding-voice.mdx +118 -25
- package/.docs/raw/agents/agent-memory.mdx +73 -89
- package/.docs/raw/agents/guardrails.mdx +1 -1
- package/.docs/raw/agents/overview.mdx +39 -7
- package/.docs/raw/agents/using-tools.mdx +95 -0
- package/.docs/raw/deployment/overview.mdx +9 -11
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +1 -1
- package/.docs/raw/frameworks/servers/express.mdx +2 -2
- package/.docs/raw/getting-started/installation.mdx +34 -85
- package/.docs/raw/getting-started/mcp-docs-server.mdx +13 -1
- package/.docs/raw/index.mdx +49 -14
- package/.docs/raw/observability/ai-tracing/exporters/otel.mdx +3 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/otel.mdx +6 -0
- package/.docs/raw/reference/scorers/answer-relevancy.mdx +105 -7
- package/.docs/raw/reference/scorers/answer-similarity.mdx +266 -16
- package/.docs/raw/reference/scorers/bias.mdx +107 -6
- package/.docs/raw/reference/scorers/completeness.mdx +131 -8
- package/.docs/raw/reference/scorers/content-similarity.mdx +107 -8
- package/.docs/raw/reference/scorers/context-precision.mdx +234 -18
- package/.docs/raw/reference/scorers/context-relevance.mdx +418 -35
- package/.docs/raw/reference/scorers/faithfulness.mdx +122 -8
- package/.docs/raw/reference/scorers/hallucination.mdx +125 -8
- package/.docs/raw/reference/scorers/keyword-coverage.mdx +141 -9
- package/.docs/raw/reference/scorers/noise-sensitivity.mdx +478 -6
- package/.docs/raw/reference/scorers/prompt-alignment.mdx +351 -102
- package/.docs/raw/reference/scorers/textual-difference.mdx +134 -6
- package/.docs/raw/reference/scorers/tone-consistency.mdx +133 -0
- package/.docs/raw/reference/scorers/tool-call-accuracy.mdx +422 -65
- package/.docs/raw/reference/scorers/toxicity.mdx +125 -7
- package/.docs/raw/reference/workflows/workflow.mdx +33 -0
- package/.docs/raw/scorers/custom-scorers.mdx +244 -3
- package/.docs/raw/scorers/overview.mdx +8 -38
- package/.docs/raw/server-db/middleware.mdx +5 -2
- package/.docs/raw/server-db/runtime-context.mdx +178 -0
- package/.docs/raw/streaming/workflow-streaming.mdx +5 -1
- package/.docs/raw/tools-mcp/overview.mdx +25 -7
- package/.docs/raw/workflows/overview.mdx +28 -1
- package/CHANGELOG.md +7 -0
- package/package.json +4 -4
- package/.docs/raw/agents/runtime-context.mdx +0 -106
- package/.docs/raw/agents/using-tools-and-mcp.mdx +0 -241
- package/.docs/raw/getting-started/model-providers.mdx +0 -63
- package/.docs/raw/tools-mcp/runtime-context.mdx +0 -63
- /package/.docs/raw/{evals → scorers/evals-old-api}/custom-eval.mdx +0 -0
- /package/.docs/raw/{evals → scorers/evals-old-api}/overview.mdx +0 -0
- /package/.docs/raw/{evals → scorers/evals-old-api}/running-in-ci.mdx +0 -0
- /package/.docs/raw/{evals → scorers/evals-old-api}/textual-evals.mdx +0 -0
- /package/.docs/raw/{server-db → workflows}/snapshots.mdx +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Model Providers | Getting Started | Mastra Docs"
|
|
3
|
-
description: "Learn how to configure and use different model providers with Mastra."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Callout } from "nextra/components"
|
|
7
|
-
|
|
8
|
-
# Model Providers
|
|
9
|
-
|
|
10
|
-
Mastra's unified model router gives you access to 541+ models from 38 providers with a single API. Switch between models and providers without changing your code. Automatic environment variable detection handles authentication, while TypeScript provides full autocomplete for every model.
|
|
11
|
-
|
|
12
|
-
## Quick Start
|
|
13
|
-
|
|
14
|
-
Simply use the `provider/model` string pattern:
|
|
15
|
-
|
|
16
|
-
```typescript showLineNumbers copy filename="src/mastra/agents/weather-agent.ts"
|
|
17
|
-
import { Agent } from "@mastra/core";
|
|
18
|
-
|
|
19
|
-
const agent = new Agent({
|
|
20
|
-
name: "WeatherAgent",
|
|
21
|
-
instructions: "You are a helpful weather assistant",
|
|
22
|
-
model: "openai/gpt-4o"
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const result = await agent.generate("What is the weather like?");
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Browse Providers
|
|
29
|
-
|
|
30
|
-
<Callout>
|
|
31
|
-
**[→ View all 38 providers and 7 gateways](../../models)**
|
|
32
|
-
|
|
33
|
-
Explore our complete catalog with logos, model counts, and documentation for each provider.
|
|
34
|
-
</Callout>
|
|
35
|
-
|
|
36
|
-
## Configuration
|
|
37
|
-
|
|
38
|
-
Models automatically detect API keys from environment variables.
|
|
39
|
-
|
|
40
|
-
## AI SDK Compatibility
|
|
41
|
-
|
|
42
|
-
While Mastra provides built-in support for 541+ models, you can also use [Vercel AI SDK](https://sdk.vercel.ai/providers/ai-sdk-providers) model providers for additional flexibility:
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
import { openai } from "@ai-sdk/openai";
|
|
46
|
-
import { Agent } from "@mastra/core";
|
|
47
|
-
|
|
48
|
-
const agent = new Agent({
|
|
49
|
-
name: "AISDKAgent",
|
|
50
|
-
model: openai("gpt-4-turbo") // AI SDK model provider
|
|
51
|
-
});
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
<Callout type="info">
|
|
55
|
-
**Recommendation**: Use Mastra's built-in model router (`"provider/model"` strings) for simplicity. Use AI SDK providers only when you need specific features not available in the built-in providers.
|
|
56
|
-
</Callout>
|
|
57
|
-
|
|
58
|
-
## Learn More
|
|
59
|
-
|
|
60
|
-
- [📚 Browse All Model Providers](../../models) - Complete list with examples
|
|
61
|
-
- [🚀 Agent Documentation](../../reference/agents/agent.mdx) - Using models with agents
|
|
62
|
-
- [⚙️ Environment Variables](../getting-started/installation.mdx#add-your-api-key) - Configuration guide
|
|
63
|
-
- [🔧 Tool Configuration](../agents/using-tools-and-mcp.mdx#adding-tools-to-an-agent) - Adding tools to agents
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Runtime context | Tools & MCP | Mastra Docs"
|
|
3
|
-
description: Learn how to use Mastra's RuntimeContext to provide dynamic, request-specific configuration to tools.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Callout } from "nextra/components";
|
|
7
|
-
|
|
8
|
-
# Tool Runtime Context
|
|
9
|
-
|
|
10
|
-
Mastra provides `RuntimeContext`, a dependency injection system that lets you configure tools with runtime variables. If you find yourself creating multiple tools that perform similar tasks, runtime context allows you to consolidate them into a single, more flexible tool.
|
|
11
|
-
|
|
12
|
-
## Overview
|
|
13
|
-
|
|
14
|
-
The dependency injection system allows you to:
|
|
15
|
-
|
|
16
|
-
1. Pass runtime configuration variables to tools through a type-safe `runtimeContext`.
|
|
17
|
-
2. Access these variables within tool execution context.
|
|
18
|
-
3. Modify tool behavior without changing the underlying code.
|
|
19
|
-
4. Share configuration across multiple tools within the same agent.
|
|
20
|
-
|
|
21
|
-
<Callout>
|
|
22
|
-
**Note:** `RuntimeContext` is primarily used for passing data *into* tool
|
|
23
|
-
executions. It's distinct from agent memory, which handles conversation
|
|
24
|
-
history and state persistence across multiple calls.
|
|
25
|
-
</Callout>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Accessing `runtimeContext` in tools
|
|
29
|
-
|
|
30
|
-
Tools can access the same `runtimeContext` used by their parent agent, allowing them to adjust behavior based on runtime configuration. In this example, the `temperature-unit` is retrieved within the tool’s `execute` function to ensure consistent formatting with the agent’s instructions.
|
|
31
|
-
|
|
32
|
-
```typescript {14-15} filename="src/mastra/tools/test-weather-tool" showLineNumbers copy
|
|
33
|
-
import { createTool } from "@mastra/core/tools";
|
|
34
|
-
import { z } from "zod";
|
|
35
|
-
|
|
36
|
-
type WeatherRuntimeContext = {
|
|
37
|
-
"temperature-unit": "celsius" | "fahrenheit";
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const testWeatherTool = createTool({
|
|
41
|
-
id: "getWeather",
|
|
42
|
-
description: "Get the current weather for a location",
|
|
43
|
-
inputSchema: z.object({
|
|
44
|
-
location: z.string().describe("The location to get weather for")
|
|
45
|
-
}),
|
|
46
|
-
execute: async ({ context, runtimeContext }) => {
|
|
47
|
-
const temperatureUnit = runtimeContext.get("temperature-unit") as WeatherRuntimeContext["temperature-unit"];
|
|
48
|
-
|
|
49
|
-
const weather = await fetchWeather(context.location, temperatureUnit);
|
|
50
|
-
|
|
51
|
-
return { result: weather };
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
async function fetchWeather(location: string, temperatureUnit: WeatherRuntimeContext["temperature-unit"]) {
|
|
56
|
-
// ...
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Related
|
|
62
|
-
|
|
63
|
-
[Agent Runtime Context](../agents/runtime-context.mdx)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|