Skip to content

armgit / kanzo

Public Imported from GitHub
0

Self-hosted, sharable kanban for humans and agents. One 4.7 MB binary, 5 MB of RAM, 10 to 60 tokens per agent reply, starts in 3 ms, zero setup.

Describe MCP task ids as plain strings

emanuele-emfecf0f5bf864
diff --git a/src/mcp.rs b/src/mcp.rs
index c100e35..1abc3f2 100644
--- a/src/mcp.rs
+++ b/src/mcp.rs
@@ -126,8 +126,9 @@ pub struct Kanzo {
tool_router: ToolRouter<Self>,
}
-/// A task, as `api#12` or just `12`.
-#[derive(Deserialize, JsonSchema)]
+/// A task, as `api#12` or just `12`. Agents are told it is a string, which keeps the
+/// tool schemas short; a bare number is accepted too.
+#[derive(Deserialize)]
#[serde(untagged)]
enum TaskKey {
Number(i64),
@@ -164,6 +165,7 @@ struct ListTasksArgs {
#[derive(Deserialize, JsonSchema)]
struct TaskArgs {
/// Task id, like api#12 or 12.
+ #[schemars(with = "String")]
id: TaskKey,
}
@@ -179,6 +181,7 @@ struct CreateTaskArgs {
#[derive(Deserialize, JsonSchema)]
struct UpdateTaskArgs {
/// Task id, like api#12 or 12.
+ #[schemars(with = "String")]
id: TaskKey,
title: Option<String>,
/// Markdown; replaces the whole description.
@@ -190,6 +193,7 @@ struct UpdateTaskArgs {
#[derive(Deserialize, JsonSchema)]
struct AddCommentArgs {
/// Task id, like api#12 or 12.
+ #[schemars(with = "String")]
id: TaskKey,
/// Markdown.
body: String,