elicit_url
Elicitation shadow crate for url::Url — makes Url usable
in MCP tool registrations via #[derive(Elicit)] and exposes URL inspection and
manipulation as MCP tools.
Why this crate
url::Url does not implement JsonSchema, which prevents it from being used directly
in #[derive(Elicit)] structs. This crate provides a transparent Url newtype that
satisfies the schema requirement while staying fully interoperable with the upstream crate.
What it provides
| Feature | Details |
|---|---|
JsonSchema |
Emits { "type": "string", "format": "uri" } |
Serialize/Deserialize |
Transparent — encodes/decodes identically to url::Url |
Deref/DerefMut |
All url::Url methods accessible without unwrapping |
From/Into |
Zero-cost conversion to/from url::Url |
#[reflect_methods] |
Inspect and manipulate URLs as MCP tool calls |
MCP tools
scheme, host, port, port_or_default, path, query, fragment,
username, has_authority, join, origin, as_str.
Usage
[]
= "0.11"
use Url;
let u = parse.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
// Relative resolution
let endpoint = u.join.unwrap;
License
Licensed under either of Apache License 2.0 or MIT at your option.