somnia-agents-invoke

Invoke Somnia Agents from the CLI and decode finalized results.

2|2|Updated May 19, 2026
One-click install
npx skills add https://github.com/somnia-chain/agentathon --skill somnia-agents-invoke-somnia-chain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: somnia-agents-invoke
Source: https://github.com/somnia-chain/agentathon/tree/main/somnia-agents-skills/skills/somnia-agents-invoke
Command: npx skills add https://github.com/somnia-chain/agentathon --skill somnia-agents-invoke-somnia-chain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dotenv, viem, zod, tsx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It removes the need to write a wrapper contract or manually handle request/ABI/deposit plumbing by letting you invoke Somnia Agents directly from your wallet and decode the finalized result.

Core Features & Use Cases

  • One-off agent invocation: Builds ABI-encoded payloads and submits createRequest or createAdvancedRequest with the correct deposit sizing for the chosen subcommittee configuration.
  • Deterministic workflow for testing: Waits for RequestFinalized, reads the request state from the pre-finalization block, and decodes the consensus result using the target agent’s ABI return type.
  • Off-chain receipts inspection: Fetches and summarizes validator receipts from the receipts service for deeper debugging of execution steps and LLM/HTTP activity.

Quick Start

Run a single invocation by calling the invoke script with your agent slug, function name, and JSON-encoded positional arguments to get a finalized, decoded result.

Frequently Asked Questions about somnia-agents-invoke

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

FAQPage Schema
How do I invoke blockchain smart contract agents from the CLI without a wrapper contract?

You can invoke Somnia agents from the CLI to get decoded, finalized outputs without deploying a custom wrapper contract. It computes deposits, submits createRequest transactions, waits for RequestFinalized, and decodes the result data.

How is the deposit calculated when submitting a request to a Somnia agent?

The deposit is computed from the request reserve plus the per-agent price multiplied by the subcommittee size. This calculation ensures correct deposit sizing for your chosen subcommittee configuration before submission.

Can I test smart contract agent calls on both mainnet and testnet?

Yes, you can execute one-off agent invocations across both mainnet and testnet. This deterministic workflow is designed for ad-hoc testing, exploration, and prototyping agent calls with single transactions.

How do I decode consensus results and inspect validator receipts for agent execution?

It reads the request state from the pre-finalization block and decodes the consensus result using the target agent's ABI return type. You can also fetch and summarize validator receipts for debugging LLM or HTTP activity.

Do I need viem and dotenv to run CLI agent invocations?

Yes, the workflow relies on dependencies like viem for blockchain interactions, dotenv for environment configuration, zod for validation, and tsx for execution. These tools handle the request, ABI encoding, and receipt decoding processes.