SkillToolResolver: (
name: string,
runtime: Runtime<TContext>
) => readonly ClientTool[] |Return the skill tools that one metadata.include_tools name stands for.
A resolver lets a skill list tools whose real names are only known at
runtime, such as generated MCP tool names, and lets one name stand for a
family of tools. It's called with the name and the agent's runtime, on
every model call while a read or pin of a skill listing that name stays in
context, and again before one of its tools runs. It may return the tools or
a promise of them.
runtime.context.[].A name that exactly matches a tool already in the request is claimed by that tool and never passed to the resolver.
// e.g. every tool on a Linear MCP connection, whatever their generated names
const resolveSkillTools: SkillToolResolver<{ workspaceId: string }> = async (
name,
runtime,
) => (await toolsForWorkspace(runtime.context.workspaceId))[name] ?? [];
createSkillsMiddleware({ backend, sources: ["/skills/"], tools: resolveSkillTools });