home / skills / bankrbot / claude-plugins / bankr-job-workflow

This skill orchestrates Bankr API jobs using the submit-poll-complete pattern to submit prompts, poll status, and report results.

npx playbooks add skill bankrbot/claude-plugins --skill bankr-job-workflow

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.4 KB
---
name: Bankr Agent - Job Workflow
description: This skill should be used when executing Bankr requests, submitting prompts to Bankr API, polling for job status, checking job progress, using Bankr MCP tools, or understanding the submit-poll-complete workflow pattern. Provides the core asynchronous job pattern for all Bankr API operations.
version: 1.0.0
---

# Bankr Job Workflow

Execute Bankr API operations using MCP tools with the asynchronous job pattern.

## Core Pattern: Submit-Poll-Complete

1. **Submit** - Send prompt via `bankr_agent_submit_prompt`, receive job ID
2. **Poll** - Check status via `bankr_agent_get_job_status` every 2 seconds
3. **Complete** - Report results when status is terminal

## MCP Tools

### `bankr_agent_submit_prompt`
Submit a natural language prompt to start a job.
- **Input**: Natural language request (e.g., "Buy $50 of ETH on Base")
- **Output**: Job ID for tracking

### `bankr_agent_get_job_status`
Check job status. Response includes:
- `status`: pending | processing | completed | failed | cancelled
- `response`: Text answer (when completed)
- `transactions`: Array of executed transactions
- `statusUpdates`: Progress messages during execution
- `error`: Error message (when failed)

### `bankr_agent_cancel_job`
Cancel a running job.

## Job Status States

| Status | Action |
|--------|--------|
| `pending` | Keep polling |
| `processing` | Keep polling, report statusUpdates |
| `completed` | Read response and transactions |
| `failed` | Check error field |
| `cancelled` | No further action |

## Timing

- **Poll interval**: 2 seconds
- **Typical completion**: 30 seconds to 2 minutes
- **Suggest cancellation**: After 3+ minutes for simple queries

## Output Guidelines

| Query Type | Output Format |
|------------|---------------|
| Price queries | State price clearly (e.g., "ETH is $3,245.67") |
| Trades | Confirm amounts and transaction details |
| Market analysis | Summarize key insights concisely |
| Polymarket | State odds with context |
| Balances | List holdings with USD values |
| Errors | Explain clearly, suggest alternatives |

## Status Update Handling

- Track last reported update count
- Only report NEW updates to avoid repetition
- Updates show agent progress (e.g., "Analyzing market data...")

## Error Recovery

If polling fails:
1. Retry after brief delay
2. Job continues server-side regardless
3. Can resume polling with same jobId

Overview

This skill implements Bankr's asynchronous submit-poll-complete job pattern for executing multi-chain DeFi operations via the Bankr MCP tools. It provides the core flow to submit natural-language prompts, poll job status, handle progress updates, and surface final responses and transactions. Use it to reliably manage long-running Bankr API tasks and recover from transient errors.

How this skill works

You submit a natural-language request with bankr_agent_submit_prompt and receive a jobId. The skill polls bankr_agent_get_job_status at a 2-second interval, reporting only new statusUpdates and watching for terminal states. When status becomes completed it returns the response text and any executed transactions; on failed or cancelled it surfaces the error and recommended next steps. It can also cancel jobs via bankr_agent_cancel_job and resume polling after transient failures.

When to use it

  • Executing Bankr operations that may take seconds to minutes (trades, swaps, multi-step flows).
  • Submitting natural-language trading or balance requests to Bankr (e.g., buy/sell, check holdings).
  • Retrieving progressive execution logs or transactions for audit and UX feedback.
  • Handling operations where server-side processing is asynchronous and status must be tracked.
  • Implementing retry and recovery logic when polling fails or times out.

Best practices

  • Poll every 2 seconds and avoid spamming; track last reported update to only emit NEW statusUpdates.
  • Apply a soft timeout: suggest cancellation or escalation after ~3 minutes for simple queries, but allow longer for complex workflows.
  • When status is completed, return both the human-readable response and the transactions array for reconciliation.
  • On failure, read the error field and provide actionable suggestions (retry, simplify request, or cancel).
  • If a poll request fails, retry after a brief delay; the job continues server-side and can be resumed with the same jobId.

Example use cases

  • Buy $50 of ETH on Base: submit prompt, poll for transaction details, confirm executed trade and tx hashes.
  • Price query: submit "What is ETH price?", poll until completed, and state price clearly (e.g., "ETH is $3,245.67").
  • Balance check: request holdings summary, poll, and present assets with USD values.
  • Market analysis: submit research prompt, stream statusUpdates like "Analyzing market data...", then summarize insights when completed.
  • Long-running multi-step DeFi flow: submit high-level instruction, monitor progress updates, and collect final transactions for on-chain verification.

FAQ

What statuses should I handle?

Handle pending, processing (keep polling and surface statusUpdates), completed (read response and transactions), failed (inspect error), and cancelled (stop polling).

How long should I poll before cancelling?

Poll every 2 seconds; for simple queries, consider cancelling after about 3 minutes. Complex jobs can take longer (30s–2min typical).

What if polling request itself fails?

Retry after a short delay. The job continues server-side and you can resume polling with the same jobId.