| Crates.io | trinkets |
| lib.rs | trinkets |
| version | 0.1.0 |
| created_at | 2025-12-14 20:27:00.484123+00 |
| updated_at | 2025-12-14 20:27:00.484123+00 |
| description | Tool registry and execution system for AI agents - goblin loot and treasures |
| homepage | |
| repository | https://github.com/moltenlabs/molten |
| max_upload_size | |
| id | 1985051 |
| size | 93,805 |
Tool registry and execution system for AI agents - goblin loot and treasures.
Trinkets provides a unified system for AI agents to discover and execute tools:
Tool trait[dependencies]
trinkets = "0.1"
use trinkets::{Tool, ToolRegistry, ToolContext, ToolOutput};
use async_trait::async_trait;
use serde_json::{json, Value};
struct MyTool;
#[async_trait]
impl Tool for MyTool {
fn name(&self) -> &str { "my_tool" }
fn description(&self) -> &str { "Does something useful" }
fn parameters_schema(&self) -> Value {
json!({
"type": "object",
"properties": {
"input": { "type": "string" }
}
})
}
async fn execute(
&self,
ctx: &ToolContext,
args: Value
) -> Result<ToolOutput, trinkets::ToolError> {
Ok(ToolOutput::success("Done!"))
}
}
// Register and use
let mut registry = ToolRegistry::new();
registry.register(MyTool);
let schemas = registry.schemas(); // For LLM function calling
shell - Execute shell commandsread_file - Read file contentswrite_file - Write to fileslist_files - List directory contentsgrep - Search with ripgrepglob - Find files by patternMIT OR Apache-2.0