Skip to main content

D-01 Tool Registry

Brick D: Tools, skills, plugins, MCP, connectors. French version: D-01-tool-registry

1. Role and responsibilities​

Versioned catalog of tools declared by Tool Manifest: input and output schemas, side effects, risk, scopes, cost.

  • Validate the manifest against tool-manifest.schema.json
  • Publish, deprecate, block a tool
  • Expose the list filtered by permissions

2. Position in the architecture and interactions​

  • Callers: POST /v1/manifests/apply, portal, CI.
  • Execution path: Synchronous.
  • Every interaction goes through the Control Plane API v1 (/v1) behind the API Gateway (D-14).

3. Open source component and developed part​

  • Open source: none (to develop)
  • Developed: Fully developed.
  • External integration through an adapter eai/integrations/<system>.py with an in-process fallback when the URL is not configured.

4. Data model​

Tables (schema eai, tenant_id RLS):

  • eai.tools

Common columns: id uuid, tenant_id uuid NOT NULL, created_at, updated_at; RLS policy current_setting('app.tenant_id', true)::uuid.

5. Contract​

  • Applied contract: tool-manifest
  • JSON Schema: contracts/v1/tool-manifest.schema.json
  • Key fields: spec.action, spec.input_schema, spec.endpoint, spec.scopes_required, spec.data_classification, spec.side_effects, spec.idempotent, spec.requires_approval, spec.risk_level, spec.cost
  • Validation: POST /v1/contracts/{name}/validate; manifest apply: POST /v1/manifests/apply.

6. API endpoints​

  • GET /v1/tools
  • POST /v1/tools
  • GET /v1/tools/{name}
  • PATCH /v1/tools/{name}
  • DELETE /v1/tools/{name}

Request POST /v1/tools:

{
"apiVersion": "eai/v1",
"kind": "Tool",
"metadata": {
"name": "jira.search",
"version": "1.2.0"
},
"spec": {
"description": "Jira search",
"action": "read",
"input_schema": {
"type": "object"
},
"endpoint": {
"type": "http",
"url": "https://<jira-host>/api"
},
"scopes_required": [
"jira:read"
],
"data_classification": "internal"
}
}

Response:

{
"name": "jira.search",
"version": "1.2.0",
"status": "active"
}

7. SDK examples​

Python:

from enterprise_ai import EnterpriseAI

client = EnterpriseAI(base_url="<control-plane-url>", api_key="eai_xxx_secret")
client.tools.create(manifest=tool_manifest)
client.tools.list()

TypeScript:

import { EnterpriseAI } from "@enterprise-ai/sdk";

const client = new EnterpriseAI({ baseUrl: "<control-plane-url>", apiKey: process.env.EAI_API_KEY });
await client.tools.create(toolManifest);

Java:

EnterpriseAIClient client = EnterpriseAIClient.builder()
.baseUrl("<control-plane-url>")
.apiKey(System.getenv("EAI_API_KEY"))
.build();
client.tools().create(toolManifest);

Go:

c, _ := eai.NewClient(eai.WithBaseURL("<control-plane-url>"), eai.WithAPIKey(os.Getenv("EAI_API_KEY")))
c.Tools.Create(ctx, toolManifest)

8. Configuration​

  • Environment variables: EAI_DATABASE_URL
  • Helm values keys: controlPlane.config, controlPlane.secrets

9. Security controls​

  • Publishing restricted to developer / tenant_admin
  • OPA policy tool.publish (high risk -> approval)
  • Every request carries the tenant resolved from the credential; PostgreSQL RLS
  • Every mutation and policy decision writes a hash-chained audit event

10. Observability​

  • Prometheus metrics: eai_tools_registered{status}
  • Traces: OpenTelemetry spans with GenAI semantic conventions (gen_ai.operation.name, gen_ai.agent.id, gen_ai.tool.name), attributes eai.tenant_id, eai.run_id, traceparent propagation.
  • Audit actions: tool.apply, tool.update, tool.delete

11. FinOps units​

  • spec.cost feeds the estimation.
  • Emitted as Usage Event (POST /v1/finops/usage) with tenant, project, agent and run.

12. Failure modes and resilience​

  • Immutable version: republishing creates a new version
  • Normalized errors (error envelope, message_i18n en/fr)

13. Standalone adoption (client of a client)​

  • enterprise_ai.tools + Control Plane + PostgreSQL.
  • SDK: enterprise_ai.tools / mcp / skills / plugins / connectors / channels
  • Minimal deployment: Helm chart with controlPlane.enabled=true and PostgreSQL; disabled external components use their in-process fallback.

14. Acceptance tests​

  1. Invalid manifest -> 422 with errors
  2. Blocked tool not listed for agents
  3. Cross-tenant access refused
  4. Error returned in fr with Accept-Language: fr