| Crates.io | adk-tool |
| lib.rs | adk-tool |
| version | 0.2.1 |
| created_at | 2025-11-30 13:50:14.22757+00 |
| updated_at | 2026-01-22 03:37:04.618365+00 |
| description | Tool system for Rust Agent Development Kit (ADK-Rust) agents (FunctionTool, MCP, Google Search) |
| homepage | |
| repository | https://github.com/zavora-ai/adk-rust |
| max_upload_size | |
| id | 1958241 |
| size | 107,498 |
Tool system for Rust Agent Development Kit (ADK-Rust) agents (FunctionTool, MCP, Google Search).
adk-tool provides the tool infrastructure for the Rust Agent Development Kit (ADK-Rust):
[dependencies]
adk-tool = "0.2.0"
Or use the meta-crate:
[dependencies]
adk-rust = { version = "0.2.1", features = ["tools"] }
use adk_tool::FunctionTool;
use adk_core::{ToolContext, Result};
use serde_json::{json, Value};
use std::sync::Arc;
async fn get_weather(_ctx: Arc<dyn ToolContext>, args: Value) -> Result<Value> {
let city = args["city"].as_str().unwrap_or("Unknown");
Ok(json!({
"city": city,
"temperature": 72,
"condition": "sunny"
}))
}
let tool = FunctionTool::new(
"get_weather",
"Get current weather for a city",
get_weather,
);
Always add a schema so the LLM knows what parameters to pass:
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(JsonSchema, Serialize, Deserialize)]
struct WeatherParams {
/// The city to get weather for
city: String,
}
let tool = FunctionTool::new("get_weather", "Get weather", get_weather)
.with_parameters_schema::<WeatherParams>();
use adk_tool::McpToolset;
use rmcp::{ServiceExt, transport::TokioChildProcess};
let client = ().serve(TokioChildProcess::new(
Command::new("npx")
.arg("-y")
.arg("@modelcontextprotocol/server-filesystem")
.arg("/path/to/files")
)?).await?;
let toolset = McpToolset::new(client)
.with_filter(|name| matches!(name, "read_file" | "write_file"));
use adk_tool::GoogleSearchTool;
let search = GoogleSearchTool::new();
// Add to agent - enables grounded web search
schemarsTool traitApache-2.0
This crate is part of the ADK-Rust framework for building AI agents in Rust.