s0214lx

Results 5 comments of s0214lx

> Here's a quick sketch of what works _right now_ to add tools dynamically (here, from calling another tool):以下是_目前_动态添加工具的快速草图(此处,通过调用另一个工具): > > from fastmcp import FastMCP, Client > > mcp =...

Can I use ctx.request_context.lifespan_context to store data that needs to be shared while the current user is using the tool?

@jlowin @strawgate Thanks for your help, this is a very effective solution.

> I believe actually the session/lifespan persists for the length of the client's connection and thus the context object that gets passed around exists for the life of that client...

> At least for me It is working with `ctx.request_context.lifespan_context` instead of `ctx.session` as mentioned by [@strawgate](https://github.com/strawgate) (fastmcp=2.3.4) I think this is correct. I did a test, returning the attributes...