From 7d4eda55e0ccaf9ec26195c8be882b466839b123 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Thu, 28 Aug 2025 18:02:07 -0300 Subject: [PATCH] docs: add as_meta parameter for AI agents in content endpoints Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/modes/server/api/item.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modes/server/api/item.rs b/src/modes/server/api/item.rs index 7562f6c..aeda553 100644 --- a/src/modes/server/api/item.rs +++ b/src/modes/server/api/item.rs @@ -257,7 +257,8 @@ pub async fn handle_post_item( path = "/api/item/latest/content", operation_id = "keep_get_item_latest_content", summary = "Download latest item content", - description = "Get raw content of the most recent item. Filter by tags. Binary content can be restricted.", + description = "Get raw content of the most recent item. Filter by tags. Binary content can be restricted. \ + AI agents should use as_meta=true to get content and metadata in a structured JSON format.", responses( (status = 200, description = "Content retrieved"), (status = 400, description = "Binary content not allowed"), @@ -270,7 +271,8 @@ pub async fn handle_post_item( ("allow_binary" = Option, Query, description = "Allow binary content"), ("offset" = Option, Query, description = "Byte offset to start reading"), ("length" = Option, Query, description = "Number of bytes to read"), - ("stream" = Option, Query, description = "Stream response (true) or build in memory (false)") + ("stream" = Option, Query, description = "Stream response (true) or build in memory (false)"), + ("as_meta" = Option, Query, description = "Return content and metadata in JSON format (recommended for AI agents)") ), security( ("bearerAuth" = []) @@ -326,7 +328,8 @@ pub async fn handle_get_item_latest_content( path = "/api/item/{item_id}/content", operation_id = "keep_get_item_content", summary = "Download item content", - description = "Get raw content of a specific item by ID. Binary content can be restricted.", + description = "Get raw content of a specific item by ID. Binary content can be restricted. \ + AI agents should use as_meta=true to get content and metadata in a structured JSON format.", responses( (status = 200, description = "Content retrieved"), (status = 400, description = "Invalid ID or binary not allowed"), @@ -339,7 +342,8 @@ pub async fn handle_get_item_latest_content( ("allow_binary" = Option, Query, description = "Allow binary content"), ("offset" = Option, Query, description = "Byte offset to start reading"), ("length" = Option, Query, description = "Number of bytes to read"), - ("stream" = Option, Query, description = "Stream response (true) or build in memory (false)") + ("stream" = Option, Query, description = "Stream response (true) or build in memory (false)"), + ("as_meta" = Option, Query, description = "Return content and metadata in JSON format (recommended for AI agents)") ), security( ("bearerAuth" = [])