Skip to content

Marketplace tools: Pinchwork, AgentID, Joy Trust as @tool pluginsΒ #1292

@MervinPraison

Description

@MervinPraison

Marketplace Interop: External A2A as Tool Plugins

Problem

Three external projects have proposed agent-to-agent integrations with PraisonAI:

Project Issue Pattern What it does
Pinchwork #1101 Delegate/Browse/Pickup/Deliver Agent marketplace β€” delegate tasks across frameworks
Joy Trust Network #1282 Trust score verification Trust verification layer before delegating to external agents
AgentID #1124 ECDSA P-256 certificates Cryptographic identity for cross-platform agent verification

Currently there is no standard way to integrate these. Each would require custom code.

Design Principle

External A2A integrations are always Tools, never modifications to the Handoff core.

This keeps the core SDK lean and allows marketplace plugins to evolve independently.

Proposed Implementation

1. Pinchwork Marketplace Tool

from praisonaiagents import tool

@tool
def pinchwork_delegate(task: str, skills_required: list = None, budget: float = 0.0) -> str:
    """Delegate a task to the Pinchwork agent marketplace.
    
    Args:
        task: Description of the task to delegate
        skills_required: List of required skills for the agent
        budget: Maximum budget for the task
    
    Returns:
        Result from the marketplace agent that completed the task
    """
    try:
        import httpx
    except ImportError:
        raise ImportError("Install with: pip install praisonai-tools[pinchwork]")
    
    # POST to Pinchwork API
    response = httpx.post("https://api.pinchwork.com/delegate", json={
        "task": task,
        "skills": skills_required or [],
        "budget": budget,
    })
    return response.json().get("result", "No result")

# Usage:
agent = Agent(
    name="orchestrator",
    tools=[pinchwork_delegate],
    handoffs=[local_agent_b],  # Mix local + remote
)

2. AgentID Verifier Hook

from praisonaiagents import tool

@tool
def verify_agent_identity(agent_url: str) -> dict:
    """Verify an external agent's identity using AgentID certificates.
    
    Args:
        agent_url: URL of the agent to verify
    
    Returns:
        Verification result with trust score and certificate details
    """
    try:
        import httpx
    except ImportError:
        raise ImportError("Install with: pip install praisonai-tools[agentid]")
    
    response = httpx.get(f"https://getagentid.dev/api/verify?agent={agent_url}")
    data = response.json()
    return {
        "verified": data.get("verified", False),
        "trust_score": data.get("trust_score", 0),
        "certificate": data.get("certificate_info", {}),
    }

3. Joy Trust Network Score Check

@tool  
def check_trust_score(agent_name: str) -> dict:
    """Check an agent's trust score on Joy Trust Network before delegation.
    
    Args:
        agent_name: Name/identifier of the agent to check
    
    Returns:
        Trust score and verification status
    """
    try:
        import httpx
    except ImportError:
        raise ImportError("Install with: pip install praisonai-tools[joy-trust]")
    
    response = httpx.get(f"https://joy-connect.fly.dev/agents/discover?name={agent_name}")
    return response.json()

4. Combined Usage Pattern

from praisonaiagents import Agent

agent = Agent(
    name="secure_orchestrator",
    instructions="Before delegating externally, always verify trust scores first.",
    tools=[verify_agent_identity, check_trust_score, pinchwork_delegate],
    handoffs=[local_researcher, local_writer],  # Local agents via handoff
)

# Agent can now:
# 1. Use handoffs for local agent-to-agent (researcher, writer)
# 2. Use verify_agent_identity before trusting external agents
# 3. Use pinchwork_delegate to send tasks to marketplace
# 4. Use check_trust_score to verify trust before delegation

Where These Live

All three should be tool plugins in PraisonAI-Tools:

PraisonAI-Tools/praisonai_tools/
β”œβ”€β”€ marketplace/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ pinchwork.py      # pinchwork_delegate tool
β”‚   β”œβ”€β”€ agentid.py        # verify_agent_identity tool
β”‚   └── joy_trust.py      # check_trust_score tool

Optional dependencies in pyproject.toml:

[project.optional-dependencies]
pinchwork = ["httpx>=0.24.0"]
agentid = ["httpx>=0.24.0"]
joy-trust = ["httpx>=0.24.0"]
marketplace = ["httpx>=0.24.0"]  # all marketplace tools

Future: before_handoff Hook Event

For users who want automatic trust verification on every handoff (not just marketplace):

from praisonaiagents.hooks import add_hook

@add_hook("before_handoff")
def auto_verify_trust(event):
    """Automatically check trust before any handoff."""
    if event.target_agent.is_remote:
        score = check_trust_score(event.target_agent.name)
        if score.get("trust_score", 0) < 0.5:
            raise HandoffError(f"Agent {event.target_agent.name} has low trust score")

This requires adding a before_handoff event type to hooks/types.py β€” tracked separately.

Related Issues

Acceptance Criteria

  • pinchwork_delegate tool implemented in PraisonAI-Tools
  • verify_agent_identity tool implemented in PraisonAI-Tools
  • check_trust_score tool implemented in PraisonAI-Tools
  • Optional dependencies configured (httpx)
  • Agent can mix local handoffs + marketplace tools
  • Real agentic test: agent uses marketplace tool with LLM
  • Lazy imports only (no httpx at module level)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingclaudeAuto-trigger Claude analysisenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions