EveProvider registered, session.tools() returns eve-native defineTools, so an eve agent gets the Tool Router meta-tools and any preloaded custom toolkits from one call. The provider also ships a (ctx, next) hook interface to intercept, allow, deny, or rewrite meta-tool calls before the model sees the result.
Usage
eve owns the agent loop and discovers tools from files, so you register the provider on the Composio client and expose the session’s tools from a file underagent/tools/.
1
Install
InstallThis walkthrough uses OpenAI directly as one concrete model provider. OpenAI is only an example: you can use any model provider supported by eve by installing its AI SDK package and configuring the corresponding credential.
2
Configure credentials
Configure credentials
.env.local
COMPOSIO_API_KEY authenticates Composio tools. OPENAI_API_KEY authenticates the model call directly with OpenAI; this setup does not route through Vercel AI Gateway.3
Configure the eve model
Configure the eve modelTo use another provider, replace
agent/agent.ts
@ai-sdk/openai, OPENAI_API_KEY, and openai(...) with the equivalent package, credential, and model factory supported by eve. Passing a provider model object calls that provider directly; an eve string model ID such as openai/gpt-5.4-mini uses Vercel AI Gateway instead.4
Register the provider and create a session
Register the provider and create a session
agent/session.ts
5
Expose the tools to eve
Expose the tools to eve
agent/tools/composio.ts
defineComposioTools(session) returns a step.started dynamic resolver and memoizes session.tools(). It resolves on every step so a resolver form re-evaluates the current principal and a failed fetch can retry on the next step; the result is cached per resolved Composio session, so a fixed session’s tool set stays stable. For a multi-user channel, pass a resolver instead: defineComposioTools((ctx) => sessionFor(ctx.session.auth.current?.principalId)).COMPOSIO_SEARCH_TOOLS, COMPOSIO_MULTI_EXECUTE_TOOL, COMPOSIO_MANAGE_CONNECTIONS) plus any preloaded custom toolkits, with auth handled in chat.
eve’s
defineTool takes plain JSON Schema, so EveProvider passes Composio’s inputParameters straight through. It does not convert to a zod schema, which would trip eve’s dynamic-tool normalizer.EveProvider stamps its own, so its tools are accepted as they are: each callback persists only the tool slug and an id for the resolve that produced it, and EveProvider re-attaches it to that resolve’s Composio executor when a parked or replayed call resumes. The binding lives only in the process that resolved the tools, so a call parked across a process restart cannot be replayed: eve surfaces the error rather than running it against a different session.
Hooks
Pass ahooks object to the constructor to wrap the Tool Router meta-tools. Each hook is (ctx, next): await next() runs the default behavior, returning a value replaces what the model sees, and ctx.deny(reason) blocks the call. ctx.request is mutable; ctx.context is read-only.
EveProviderHooks:
ctx.request carries the meta-tool’s raw { slug, args }, and ctx.deny is also exported as denyEveToolCall(reason).
Require approval
Map Composio tools onto eve’s durable approval flow withneedsApproval. The callback receives the original Composio tool plus eve’s approval context:
true, eve pauses before execution and asks the user to approve the call. requireApprovalForTools protects both direct calls and matching entries inside COMPOSIO_MULTI_EXECUTE_TOOL. Use an exact slug allowlist for side-effecting tools rather than approving every tool in a toolkit.