periplon 0.2.0

Rust SDK for building multi-agent AI workflows and automation
Documentation
use crate::error::Result;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolDefinition {
    pub name: String,
    pub description: String,
    pub input_schema: serde_json::Value,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ToolResult {
    pub content: serde_json::Value,
    pub is_error: bool,
}

#[async_trait]
pub trait McpServer: Send + Sync {
    fn name(&self) -> &str;
    async fn list_tools(&self) -> Result<Vec<ToolDefinition>>;
    async fn call_tool(&self, name: &str, args: serde_json::Value) -> Result<ToolResult>;
}