agentToolIdidentifierrequiredWhat identifies the tool, made by the application
Becomes the column agent_tool_id of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:84
A tool that agents may be granted: what it is called, the permission a call needs, how risky it is
Model identityAgent. Written in commons/data/models/identity-agent/mod.ts:81. Identified by agentToolId.
agentToolIdidentifierrequiredWhat identifies the tool, made by the application
Becomes the column agent_tool_id of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:84
argsSchemaHashtextoptionalA hash of the schema of its arguments
Becomes the column args_schema_hash of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:90
definitiontextrequiredWhat it does
Becomes the column definition of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:82
nametextrequiredWhat the tool is called, unique within its tenant
Becomes the column name of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:85
riskLevelcode of riskLevelrequiredHow much harm it can do
Becomes the column risk_level of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:88
serverAudiencetextoptionalThe server or API it is on
Becomes the column server_audience of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:87
sideEffectcode of sideEffectrequiredWhat it does
Becomes the column side_effect of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:89
statuscode of useStatusrequiredWhether it is in use
Becomes the column status of agent_tool.
Written at commons/data/models/identity-agent/mod.ts:91
permissiononeThe permission a call needs: one path for tools, APIs and screens To permission. Written at commons/data/models/identity-agent/mod.ts:81
tenantoptionalThe tenant it is for; empty for the platform's To tenant. Written at commons/data/models/identity-agent/mod.ts:129
Projects to the table agent_tool with the primary key agent_tool_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
agent_tool_id | text | false | attribute | agentTool.agentToolId |
args_schema_hash | text | true | attribute | agentTool.argsSchemaHash |
definition | text | false | attribute | agentTool.definition |
name | text | false | attribute | agentTool.name |
permission_id | text | false | reference | agentTool.permission |
risk_level | text | false | attribute | agentTool.riskLevel |
server_audience | text | true | attribute | agentTool.serverAudience |
side_effect | text | false | attribute | agentTool.sideEffect |
status | text | false | attribute | agentTool.status |
tenant_id | text | true | reference | agentTool.tenant |
CREATE TABLE IF NOT EXISTS "agent_tool" (
"agent_tool_id" VARCHAR NOT NULL PRIMARY KEY,
"name" VARCHAR NOT NULL,
"definition" VARCHAR NOT NULL,
"server_audience" VARCHAR,
"risk_level" VARCHAR NOT NULL,
"side_effect" VARCHAR NOT NULL,
"args_schema_hash" VARCHAR,
"status" VARCHAR NOT NULL,
"tenant_id" VARCHAR,
"permission_id" VARCHAR NOT NULL,
CONSTRAINT "agent_tool_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "agent_tool_permission_id_fk" FOREIGN KEY ("permission_id") REFERENCES "permission" ("permission_id"),
CONSTRAINT "agent_tool_name_uq" UNIQUE ("name"),
CONSTRAINT "agent_tool_risk_level_ck" CHECK ("risk_level" IN ('low', 'medium', 'high', 'critical')),
CONSTRAINT "agent_tool_side_effect_ck" CHECK ("side_effect" IN ('none', 'read', 'write', 'external', 'irreversible')),
CONSTRAINT "agent_tool_status_ck" CHECK ("status" IN ('active', 'retired'))
);CREATE TABLE IF NOT EXISTS "agent_tool" (
"agent_tool_id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"definition" TEXT NOT NULL,
"server_audience" TEXT,
"risk_level" TEXT NOT NULL,
"side_effect" TEXT NOT NULL,
"args_schema_hash" TEXT,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
"permission_id" TEXT NOT NULL,
CONSTRAINT "agent_tool_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "agent_tool_permission_id_fk" FOREIGN KEY ("permission_id") REFERENCES "permission" ("permission_id"),
CONSTRAINT "agent_tool_name_uq" UNIQUE ("name"),
CONSTRAINT "agent_tool_risk_level_ck" CHECK ("risk_level" IN ('low', 'medium', 'high', 'critical')),
CONSTRAINT "agent_tool_side_effect_ck" CHECK ("side_effect" IN ('none', 'read', 'write', 'external', 'irreversible')),
CONSTRAINT "agent_tool_status_ck" CHECK ("status" IN ('active', 'retired'))
);CREATE TABLE IF NOT EXISTS "agent_tool" (
"agent_tool_id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"definition" TEXT NOT NULL,
"server_audience" TEXT,
"risk_level" TEXT NOT NULL,
"side_effect" TEXT NOT NULL,
"args_schema_hash" TEXT,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
"permission_id" TEXT NOT NULL,
CONSTRAINT "agent_tool_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "agent_tool_permission_id_fk" FOREIGN KEY ("permission_id") REFERENCES "permission" ("permission_id"),
CONSTRAINT "agent_tool_name_uq" UNIQUE ("name"),
CONSTRAINT "agent_tool_risk_level_ck" CHECK ("risk_level" IN ('low', 'medium', 'high', 'critical')),
CONSTRAINT "agent_tool_side_effect_ck" CHECK ("side_effect" IN ('none', 'read', 'write', 'external', 'irreversible')),
CONSTRAINT "agent_tool_status_ck" CHECK ("status" IN ('active', 'retired'))
);Read and written from TypeScript with the types the model gives: import { agentTool } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-agent.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { agentTool } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(agentTool).select((s) => ({ agentToolId: s.agentTool.agentToolId, name: s.agentTool.name })).run(runner);