| Crates.io | thulp-query |
| lib.rs | thulp-query |
| version | 0.2.0 |
| created_at | 2026-01-15 00:09:38.925187+00 |
| updated_at | 2026-01-15 07:13:18.631849+00 |
| description | Query engine for searching and filtering thulp tools |
| homepage | |
| repository | https://github.com/dirmacs/thulp |
| max_upload_size | |
| id | 2044224 |
| size | 20,703 |
Query engine for searching and filtering tools in the Thulp framework.
This crate provides a DSL for querying tool definitions by various criteria such as name, description, parameters, and more. It's particularly useful for building intelligent tool discovery systems that can match user intent to available tools.
use thulp_query::{QueryBuilder, QueryCriteria};
use thulp_core::ToolDefinition;
// Create a query using the builder pattern
let query = QueryBuilder::new()
.name("file_*")
.description("read")
.min_parameters(1)
.build();
// Execute against a collection of tools
let tools: Vec<ToolDefinition> = vec![/* ... */];
let results = query.execute(&tools);
The crate also supports parsing natural language queries:
use thulp_query::parse_query;
// Parse a natural language query
let criteria = parse_query("name:search and has:query").unwrap();
let query = Query::new(criteria);
Name(String) - Match tools by name (supports wildcards with *)Description(String) - Match tools by description keywordHasParameter(String) - Match tools with specific parameterMinParameters(usize) - Match tools with at least N parametersMaxParameters(usize) - Match tools with at most N parametersAnd(Vec<QueryCriteria>) - Combine criteria with ANDOr(Vec<QueryCriteria>) - Combine criteria with ORNot(Box<QueryCriteria>) - Negate a criteriaLicensed under either of:
at your option.