MastraM
Mastra9mo ago
vz

Dependency injection support in mastra client

does dependency inject only support agent obtained from mastra? not mastra client?

i am doing some thing like:
const agent = mastraClient.getAgent(xxxx);
const container = new Container<MyContainer>();
container.set("xxxxx", something here);
const response = await agent.stream({
messages: [userMessage],
xxxx
container,
});

and getting xxxx from container inside tool is not there.

any other way to pass info to tool?
Was this page helpful?