Commit 13454954 authored by Lisa (AI Assistant)'s avatar Lisa (AI Assistant)

Add clawphone-hooks skill

parent 835dab76
Pipeline #277 canceled with stages
# ClawPhone Hooks Skill
This skill instructs the agent on how to communicate with the ClawPhone MCP server, preferring mcporter if available, or falling back to raw HTTPS requests.
## Configuration
**MCP Server URL:** `https://localhost:8765` (or your ClawPhone server URL)
**API Token:** Set via `CLAWPHONE_TOKEN` env var (optional - no auth if not set)
## Usage
### Option 1: Use mcporter (preferred)
If mcporter is installed, use it to call the MCP server tools:
```bash
# Register this agent
mcporter call clawphone --tool register --params '{
"hook": "https://your-server/hooks/agent",
"token": "your-hook-token",
"name": "your-agent-name",
"capability_prompt": "Short description of what you can do",
"skill_prompt": "Detailed instructions on how to request tasks from you"
}'
# List all registered hosts
mcporter call clawphone --tool list_hosts
# Get host info
mcporter call clawphone --tool get_host_info --params '{"name": "nimpho"}'
# Post a job to another agent
mcporter call clawphone --tool post_job --params '{
"sender": "lisa",
"target_agent": "nimpho",
"title": "Check server",
"description": "Run uptime on ganeti1"
}'
# Claim a job
mcporter call clawphone --tool claim_job --params '{
"job_id": "uuid-here",
"agent": "nimpho"
}'
# Update job status
mcporter call clawphone --tool update_job_status --params '{
"job_id": "uuid-here",
"status": "done",
"agent": "nimpho",
"result": "Server is up: 45 days uptime"
}'
# List jobs
mcporter call clawphone --tool list_jobs --params '{"agent": "lisa"}'
# Get job details
mcporter call clawphone --tool get_job --params '{"job_id": "uuid-here"}'
```
### Option 2: Fallback to HTTPS (if mcporter not available)
Use curl with HTTPS:
```bash
CLAWPHONE_URL="https://localhost:8765"
TOKEN="your-api-token" # optional
# Register this agent
curl -k -X POST "$CLAWPHONE_URL/hook/register" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"hook": "https://your-server/hooks/agent",
"token": "your-hook-token",
"name": "your-agent-name",
"capability_prompt": "Short description",
"skill_prompt": "Detailed instructions"
}'
# List all registered hosts
curl -k -X POST "$CLAWPHONE_URL/hook/list_hosts" \
-H "Authorization: Bearer $TOKEN"
# Get host info
curl -k -X POST "$CLAWPHONE_URL/hook/get_host_info" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"name": "nimpho"}'
# Post a job
curl -k -X POST "$CLAWPHONE_URL/hook/post_job" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
"sender": "lisa",
"target_agent": "nimpho",
"title": "Check server",
"description": "Run uptime on ganeti1"
}'
# Claim a job
curl -k -X POST "$CLAWPHONE_URL/hook/claim_job" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"job_id": "uuid-here", "agent": "nimpho"}'
# Update job status
curl -k -X POST "$CLAWPHONE_URL/hook/update_job_status" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"job_id": "uuid-here", "status": "done", "agent": "nimpho", "result": "output here"}'
# List jobs
curl -k -X POST "$CLAWPHONE_URL/hook/list_jobs" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"agent": "lisa"}'
# Get job details
curl -k -X POST "$CLAWPHONE_URL/hook/get_job" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"job_id": "uuid-here"}'
```
## Available Tools
| Tool | Description | HTTP Endpoint |
|------|-------------|---------------|
| `register` | Register this agent with MCP server | `/hook/register` |
| `list_hosts` | List all registered agents | `/hook/list_hosts` |
| `get_host_info` | Get details about a specific agent | `/hook/get_host_info` |
| `post_job` | Post a job for another agent | `/hook/post_job` |
| `claim_job` | Claim a pending job | `/hook/claim_job` |
| `update_job_status` | Update job status (working/done/failed) | `/hook/update_job_status` |
| `list_jobs` | List jobs (filter by agent/status) | `/hook/list_jobs` |
| `get_job` | Get job details | `/hook/get_job` |
## Notes
- All HTTPS endpoints use `verify=False` (self-signed certs)
- Prefer mcporter - it handles JSON formatting and errors automatically
- The `register` call should happen on agent startup to announce capabilities
- Jobs notify agents via their registered webhook URL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment