From 79e2a2348cce2d6e076b92a8fa898f60331f36df Mon Sep 17 00:00:00 2001 From: Nacorid Date: Sat, 5 Sep 2026 01:59:29 +0000 Subject: [PATCH 1/2] Fix getPost test client field name: actor -> author - testClient/main.go:139: Changed JSON field from 'actor' to 'author' to match GetPostRequest schema - The handler expects 'author' field, test client was sending 'actor' causing validation error --- testClient/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testClient/main.go b/testClient/main.go index 4a4a5c2..fee35cd 100644 --- a/testClient/main.go +++ b/testClient/main.go @@ -136,7 +136,7 @@ func main() { {"getFeed", "POST", "getFeed", `{"uri": "https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/feed/whats-hot"}`}, {"getActor", "POST", "getActor", `{"author": "did:plc:z72i7hdynmk6r22z27h6tvur"}`}, {"searchActors", "POST", "searchActors", `{"query": "test", "limit": 5}`}, - {"getPost", "POST", "getPost", `{"actor":"sharkgamiart.bsky.social","rkey":"3m47y27c67c2b"}`}, + {"getPost", "POST", "getPost", `{"author":"sharkgamiart.bsky.social","rkey":"3m47y27c67c2b"}`}, {"getLatestPosts", "POST", "getLatestPosts", `{"author":"sharkgamiart.bsky.social","limit": 5}`}, {"getPostsInTime", "POST", "getPostsInTime", `{"author":"sharkgamiart.bsky.social","startTime": "2024-01-01T00:00:00Z","endTime": "2024-12-31T23:59:59Z","limit": 5}`}, {"getStyleProfile", "POST", "getStyleProfile", `{"author":"did:plc:z72i7hdynmk6r22z27h6tvur"}`}, From 9e12c6cac838101db977a7bf8327f4dd52a9cf1b Mon Sep 17 00:00:00 2001 From: Nacorid Date: Sat, 5 Sep 2026 02:09:00 +0000 Subject: [PATCH 2/2] Align schemaExtra input fields with actual request structs - Changed 'actor' to 'author' in schemaExtra input BodyFields for: - getPost - getLatestPosts - getPostsInTime - getStyleProfile - findSimilarUsers - These now match the actual request struct field names (Author) - Output BodyFields remain unchanged (still use 'actor' for response) --- internal/server/tools.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/server/tools.go b/internal/server/tools.go index 9f495c9..ee16e6b 100644 --- a/internal/server/tools.go +++ b/internal/server/tools.go @@ -51,13 +51,13 @@ func (s *Server) registerTools() { Input: GetPostRequest{}, Output: GetPostResponsePost{}, Handler: s.getPost, Price: "0.01", Extra: schemaExtra( map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did or handle of an actor", Required: true}, + "author": Bodyfield{Type: "string", Description: "Did or handle of an author", Required: true}, "rkey": Bodyfield{Type: "string", Description: "Record key of the post", Required: true}, "collection": Bodyfield{Type: "string", Description: "Collection the post belongs to (Bluesky only). Defaults to 'app.bsky.feed.post'", Required: false}, }, map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did of the actor"}, - "post": Bodyfield{Type: "object", Description: "The post object. Includes the post content 'content', like 'likes', quote 'quotes', replies 'replies' and repost 'reposts' count"}, + "author": Bodyfield{Type: "string", Description: "Did of the author"}, + "post": Bodyfield{Type: "object", Description: "The post object. Includes the post content 'content', like 'likes', quote 'quotes', replies 'replies' and repost 'reposts' count"}, }, ), }, @@ -66,12 +66,12 @@ func (s *Server) registerTools() { Input: GetLatestPostsRequest{}, Output: GetLatestPostsResponse{}, Handler: s.getLatestPosts, Price: "0.10", Extra: schemaExtra( map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did or handle of an actor", Required: true}, - "n": Bodyfield{Type: "integer", Description: "Number of posts to retrieve, maximum 50", Required: true}, + "author": Bodyfield{Type: "string", Description: "Did or handle of an author", Required: true}, + "n": Bodyfield{Type: "integer", Description: "Number of posts to retrieve, maximum 50", Required: true}, }, map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did of an actor"}, - "posts": Bodyfield{Type: "array", Description: "Array of post objects. Each includes the post content 'content', like 'likes', quote 'quotes', replies 'replies' and repost 'reposts' count"}, + "author": Bodyfield{Type: "string", Description: "Did of an actor"}, + "posts": Bodyfield{Type: "array", Description: "Array of post objects. Each includes the post content 'content', like 'likes', quote 'quotes', replies 'replies' and repost 'reposts' count"}, }, ), }, @@ -80,14 +80,14 @@ func (s *Server) registerTools() { Input: GetPostsInTimeRequest{}, Output: GetPostsInTimeResponse{}, Handler: s.getPostsInTime, Price: "0.10", Extra: schemaExtra( map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did or handle of an actor", Required: true}, - "start": Bodyfield{Type: "string", Description: "Start time in RFC3339 format", Required: true}, - "end": Bodyfield{Type: "string", Description: "End time in RFC3339 format", Required: true}, - "n": Bodyfield{Type: "integer", Description: "Maximum number of posts to retrieve, maximum 50", Required: true}, + "author": Bodyfield{Type: "string", Description: "Did or handle of an author", Required: true}, + "start": Bodyfield{Type: "string", Description: "Start time in RFC3339 format", Required: true}, + "end": Bodyfield{Type: "string", Description: "End time in RFC3339 format", Required: true}, + "n": Bodyfield{Type: "integer", Description: "Maximum number of posts to retrieve, maximum 50", Required: true}, }, map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did of an actor"}, - "posts": Bodyfield{Type: "array", Description: "Array of post objects. Each includes the post content 'content', like 'likes', quote 'quotes', replies 'replies' and repost 'reposts' count"}, + "author": Bodyfield{Type: "string", Description: "Did of an actor"}, + "posts": Bodyfield{Type: "array", Description: "Array of post objects. Each includes the post content 'content', like 'likes', quote 'quotes', replies 'replies' and repost 'reposts' count"}, }, ), }, @@ -96,7 +96,7 @@ func (s *Server) registerTools() { Input: GetStyleProfileRequest{}, Output: GetStyleProfileResponse{}, Handler: s.getStyleProfile, Price: "0.36", Extra: schemaExtra( map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did or handle of an actor", Required: true}, + "author": Bodyfield{Type: "string", Description: "Did or handle of an author", Required: true}, }, map[string]any{ "PersonaEmbedding": Bodyfield{Type: "array", Description: "Embedding vector representing the actor's persona"}, @@ -111,7 +111,7 @@ func (s *Server) registerTools() { Input: FindSimilarUsersRequest{}, Output: FindSimilarUsersResponse{}, Handler: s.getSimilarProfiles, Price: "0.05", Extra: schemaExtra( map[string]any{ - "actor": Bodyfield{Type: "string", Description: "Did or handle of an author", Required: true}, + "author": Bodyfield{Type: "string", Description: "Did or handle of an author", Required: true}, }, map[string]any{ "matches": Bodyfield{Type: "array", Description: "Ranked list of similar profiles (author, platform, similarity, top keywords, style summary, post count)"},