agent-tools

Author and register governed AI tools for AdonisJS agent applications.

1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/DavideCarvalho/adonis-agora-agent --skill agent-tools-davidecarvalho
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-tools
Source: https://github.com/DavideCarvalho/adonis-agora-agent/tree/main/packages/adonis/skills/agent-tools
Command: npx skills add https://github.com/DavideCarvalho/adonis-agora-agent --skill agent-tools-davidecarvalho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building tools for an AI agent is easy, but making them governed is hard: tools need role-based gating, human approval for mutations, tenant-scoped data access, and reliable discovery at boot. This Skill guides you through authoring, registering, and debugging governed tools for @adonis-agora/agent so the model only ever sees and calls what the acting user is allowed to use. ## Core Features & Use Cases - Class and functional tool authoring: Create tools via @AiTool decorated classes, ReadTool/ActionTool subclasses, or defineTool functions with Standard Schema inputs (Zod, Valibot, ArkType). - Governed execution: read tools auto-execute while action tools pause for human-in-the-loop approval, with roles/ability fail-closed gating and constructor dependency injection via the AdonisJS IoC container. - Governed SQL access: The dataTool satellite lets the agent run read-only SELECT queries against a role-to-table allow-list with tenant scoping, LIMIT injection, and result truncation. - Use Case: You add a get_order tool but the model never calls it — this Skill explains that missing roles means the tool inherits defaultRoles ['ADMIN'], so MEMBER actors never have it offered to the model. ## Quick Start Ask the AI to write a governed read tool in app/agent_tools that fetches data scoped to ctx.actor and registers it through the generated tools barrel.

Frequently Asked Questions about agent-tools

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a tool for an AI agent in AdonisJS?▼

Create a class in app/agent_tools extending ReadTool or ActionTool with a static tool definition containing name, description, and a Zod input schema. The provider discovers it via the generated .adonisjs/agent/tools.js barrel and registers it at boot.

Why is my agent tool never called by the model?▼

A tool without an explicit roles array inherits defaultRoles, which is ['ADMIN'] by default, so non-admin actors never have it offered to the model. Add roles like ['MEMBER'] to the static tool definition to make it reachable.

What is the difference between ReadTool and ActionTool?▼

ReadTool pins kind to 'read' and auto-executes immediately, while ActionTool pins 'action' and suspends the run pending human approval via the approve or reject endpoints. Do not redeclare kind on subclasses since the base already pins it.

Can I let the AI agent query my SQL database safely?▼

Yes, use dataTool with a required tableAccess allow-list mapping roles to table groups, plus optional tenant scoping and maxRows limits. It validates single SELECT statements, injects LIMIT, and truncates oversized results before they reach the model.

How do I inject services into an agent tool class?▼

Decorate the tool class with @inject() from @adonisjs/core and declare dependencies in the constructor. Class tools resolve lazily through the IoC container on first invocation and are cached afterward, so boot is never blocked.

Why did all my tools disappear after moving the tools directory?▼

The provider imports the barrel from the fixed path .adonisjs/agent/tools.js. If you change the toolsHook output path, the provider silently falls back to scanning app/agent_tools; change only source and importAlias together and leave output at its default.