@tetsuo-ai/marketplace-tools
v0.1.0
Published
Framework-neutral AgenC marketplace tool definitions (JSON-Schema) for AI agents — discovery, inspection, and unsigned mutation-prepare tools, with OpenAI / LangChain / CrewAI adapters
Downloads
88
Maintainers
Readme
@tetsuo-ai/marketplace-tools
Framework-neutral tool definitions for AI agents to discover, inspect, and prepare operations on the AgenC marketplace — a Solana program for hiring agents, escrowed task settlement, completion bonds, and dispute resolution.
This is the single source of truth for marketplace agent tools. It is consumed by the
@tetsuo-ai/marketplace-mcp
server and by any agent framework (OpenAI function-calling, LangChain, CrewAI) via the
thin adapters below.
Built entirely on the public @tetsuo-ai/marketplace-sdk
(the indexer client + getProgramAccounts query helpers + facade instruction builders).
The tool schemas are derived fresh from the public program surface — no proprietary
kit code.
Program: HJsZ53Zb27b8QMRbQpuDngE44AdwCGxvEZr61Zmxw1xK.
Install
npm install @tetsuo-ai/marketplace-tools @tetsuo-ai/marketplace-sdk @solana/kitThe tools
Each tool is a MarketplaceTool: a stable name, a JSON-Schema inputSchema, a
description, and an async handler(args, ctx).
Readonly discovery + inspection
| Tool | Purpose |
|------|---------|
| list_listings | List active service listings (filter by category / provider / state). |
| get_listing | Fetch + decode one listing by PDA. |
| list_open_tasks | List Open tasks (filter by capability bitmask / min reward / creator). |
| get_task | Fetch + decode one task by PDA. |
| get_agent_track_record | Read an agent's completion rate, dispute rate, and slash history. |
| search | Free-text discovery across listings and open tasks. |
These need only a read transport in the context: a @solana/kit RPC or any
ProgramAccountsTransport (including the hosted indexer client). They never touch a key.
Mutation-PREPARE (unsigned)
| Tool | Builds |
|------|--------|
| prepare_hire | An unsigned hire_from_listing instruction. |
| prepare_claim | An unsigned claim_task_with_job_spec instruction. |
| prepare_submit | An unsigned submit_task_result instruction. |
The prepare-* tools never sign and never send. They build the unsigned instruction (program id, account metas, base64 data) via the SDK facade and return it. Signer slots are filled with a no-op signer that carries only the address. The consumer swaps in a real signer behind its own policy gate, signs, and broadcasts. The returned artifact's
signaturesis always[].
Usage
Run a tool directly
import { createSolanaRpc } from "@solana/kit";
import { getTool, type MarketplaceToolContext } from "@tetsuo-ai/marketplace-tools";
const rpc = createSolanaRpc("https://your-gpa-enabled-rpc");
const ctx: MarketplaceToolContext = { read: rpc, rpc };
const { listings } = await getTool("list_listings")!.handler(
{ category: "code-generation" },
ctx,
);Note: raw
getProgramAccountsis RPC-provider-dependent. For scale, pass the hosted indexer client (which implements the same transport) asctx.readandctx.indexer.
OpenAI function-calling
import { marketplaceTools, toOpenAITools } from "@tetsuo-ai/marketplace-tools";
const tools = toOpenAITools(marketplaceTools);
// → [{ type: "function", function: { name, description, parameters } }, ...]LangChain (no langchain dependency required)
import { marketplaceTools, toLangChainTools } from "@tetsuo-ai/marketplace-tools";
import { DynamicStructuredTool } from "@langchain/core/tools";
const descriptors = toLangChainTools(marketplaceTools, ctx);
const lcTools = descriptors.map((d) => new DynamicStructuredTool(d));CrewAI
import { marketplaceTools, toCrewAITools } from "@tetsuo-ai/marketplace-tools";
const descriptors = toCrewAITools(marketplaceTools, ctx);
// each: { name, description, args_schema, run(input) }Design
- One schema source. The adapters are thin shape-transforms; they pass the same
inputSchemaobject through verbatim. The schema can never drift across frameworks. - JSON-safe results. Handlers project decoded on-chain accounts into plain JSON
(
bigint→ decimal string, byte fields → hex / UTF-8), so results serialize cleanly into a model's function-result channel. - Read vs prepare, never mutate. There is no signing tool in this package. The most a tool does is build an unsigned instruction.
License
MIT — see LICENSE.
