lauren-framework/lauren-ai/building-tools
Claude Code and agent skill by lauren-framework/lauren-ai
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Creates tools for lauren-ai agents using @tool() on async functions or classes. Use when implementing a @tool() function or class, working with ToolContext for DI injection, adding caching, HITL approval, or using built-in skills like WebSearchTool, HttpFetchTool, or CodeExecutionTool.
Install
npx vskill@latest install lauren-framework/lauren-ai/building-toolsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as lauren-framework/lauren-ai/building-tools.
Usecodemap find "SymbolName"to locate any symbol before reading — it givesexact file + line range and is faster than grep across the whole repo.
Building Tools with lauren-ai
Critical rule — tool annotations must resolve
`from __future__ import annotations` is supported, but every type used by `@tool()` must resolve when schema generation runs.
@tool() resolves annotations when it builds the JSON schema. Future annotations are supported, but unresolved forward references and circular imports in function-form tool files still break schema generation.
A safe reminder comment is:
Quick start — function-form tool
Attach it to an agent:
Quick start — class-form tool
Use a class when the tool needs injected dependencies. The method must be named run() — not __call__(). The @tool() decorator looks for run; a __call__ is silently ignored and the decorator will raise ValueError.
ToolContext — DI injection, not LLM input
ToolContext is never included in the JSON schema sent to the LLM. ToolExecutor injects it automatically at call time. Use it to:
- Access the agent's
AgentContextviactx.agent_context - Read the authenticated user identity from
ctx.execution_context.request.state - Identify the current turn number via
ctx.turn
The generated schema contains zero parameters:
Schema generation rules
| Python annotation | JSON Schema type | Required? | ||
|---|---|---|---|---|
str | "string" | yes (unless Optional) | ||
int / float | "number" | yes (unless Optional) | ||
bool | "boolean" | yes (unless Optional) | ||
dict | "object" | yes (unless Optional) | ||
list | "array" | yes (unless Optional) | ||
Optional[T] / `T \ | None` | type T | no | |
ctx: ToolContext / `ctx: ToolContext \ | None = None` | — | excluded entirely | |
| parameter with default value | type T | no |
Parameter descriptions come from the Args: section of the Google-style docstring. Always document every parameter.
Safety invariants
| Rule | Why | |
|---|---|---|
| `run()` not `__call__()` | @tool() looks for run; a __call__ method is silently ignored | |
| Resolvable tool annotations | Future annotations are supported, but @tool() still needs every referenced type to resolve when it builds the schema | |
| Decorate with `@tool()` (parentheses required) | Bare @tool raises DecoratorUsageError | |
| Never use LLM-supplied identity | Read from ctx.execution_context.request.state — see security.md | |
| Always return a `dict` | LLM receives the JSON-serialised return value as the tool result |
Reference files
| File | Contents | |
|---|---|---|
| tools.md | Full reference: schema rules, HITL approval, caching, on_tool_result hook, built-in skills | |
| ../securing-agents/security.md | Secure tool patterns using ToolContext.execution_context | |
| ../building-agents/agents.md | @agent, lifecycle hooks, attaching tools via @use_tools |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/building-tools/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lauren-framework/lauren-ai/building-tools)