Implementations are the code files you write to handle EDGE tool executions. When an agent calls a tool with execution type EDGE, the request is routed to the Edge Connector, which loads the corresponding implementation, executes it with the provided parameters, and returns a structured result. This page explains how to create, test, package, and deploy custom implementations.
Every EDGE tool in the nara registry has a defined set of input parameters (a schema) and a result schema. An implementation is a JavaScript or TypeScript file that exports a handler function matching those schemas. The handler receives the parsed parameters and an execution context, performs the required work (calling an API, querying a database, running a system command), and returns a result object.
Implementations are organized as individual files in a tools/ directory, one file per tool. This structure allows the Edge Connector to bundle, version, and distribute each tool independently.
The fastest way to create a new implementation is to use the generate command. It connects to the nara platform server, fetches the tool’s schemas, and generates a properly typed TypeScript file.
The CLI discovers all tool source files in tools/ (.ts, .js, .mjs, .cjs).
Each tool is compiled individually using esbuild into dist/tools/.
An auto-generated dist/index.js is created that exports all tool handlers.
Any .ref.json reference files are included in the manifest (for tools using server-hosted versions).
A manifest (manifest.json) is created with the organization ID, language, tool entries (name, checksum, size), references, build timestamp, and overall checksum.
Everything is archived into a .tgz file in the output directory.
If you have a package.json in your implementations directory with dependencies, the CLI automatically runs pnpm install if node_modules/ does not exist.
TypeScript compilation is handled automatically by esbuild during the packaging step. Each tool file is bundled individually, producing a self-contained .js file per tool. This means:
Tools are isolated from each other at the bundle level.
Dependencies are inlined (no node_modules needed in the bundle).
The build is fast — esbuild processes files in milliseconds.
To skip the build step (if you have already compiled manually), use --no-build:
Always wrap your implementation logic in try/catch. Return structured error objects with
descriptive messages. Set isRetryable: true for transient errors (network timeouts, temporary
unavailability) and isRetryable: false for permanent failures (invalid input, missing
resource).
Return structured results
Match the tool’s result schema exactly. The agent receives the result object and uses it to
formulate responses. Include all fields the schema expects, even if some are null or empty.
Respect timeouts
Tool executions have a timeout enforced by the platform server. Keep implementations fast and
responsive. For long-running operations, consider breaking them into smaller steps or returning
a status that the agent can poll.
Keep secrets secure
Never hardcode credentials in implementation files. Use environment variables, secrets managers,
or the Edge Connector’s configuration to inject sensitive values at runtime. Tool bundles are
stored on the platform server.