Effect CommunityEC
Effect Community3mo ago
2 replies
marbemac

Dynamic Tool Pattern Support in Effect/AI Library

hi, does effect/ai support a "dynamic" tool pattern? by this i mean when the tools available to the llm are decided at runtime, and the tool definitions (such as their input schema) are not defined inline at runtime. these schemas are retrieved from some other place, such as a db (probably as json schema).

i was looking at using @effect/ai but it seems like tools require effect schema definitions at runtime? and I don't see a way to either go from json schema -> effect schema or to serialize an effect schema (to store in db) and deserialize to create runtime version.

Some other use cases:

- MCP (Model Context Protocol) Tools - When fetching tools from MCP servers, their schemas are discovered at runtime
- User-defined Functions - Functions loaded dynamically based on user configuration
- External Tool Sources - Tools loaded from databases or external APIs
- Runtime Tool Generation - Generating tools based on user input or application state
Was this page helpful?