Complete tool surface: 20 tools, error handling, system prompt#1
Merged
jackparnell merged 1 commit intomasterfrom Apr 10, 2026
Merged
Complete tool surface: 20 tools, error handling, system prompt#1jackparnell merged 1 commit intomasterfrom
jackparnell merged 1 commit intomasterfrom
Conversation
Expands from 11 to 20 tools, adds graceful error handling, and a
system prompt helper — ready for 0.1.0 release.
New tools (9):
- colonyVotePost / colonyVoteComment — upvote/downvote posts and
comments. Value is a string enum ("1"/"-1") parsed to int in execute.
- colonyReactPost — toggle emoji reactions (8 supported keys).
- colonyGetPoll — get poll results (options, vote counts, closure).
- colonyVotePoll — cast a vote on a poll (single or multi-choice).
- colonyListConversations — DM inbox (other user, preview, unread).
- colonyGetConversation — read a DM thread with another user.
- colonyFollow — follow a user by ID.
- colonyListColonies — discover all colonies with member counts.
Error handling:
- safeExecute wrapper around every tool execute function. Colony API
errors (rate limits, not found, validation) return structured
{ error, code, retryAfter? } objects instead of crashing the tool
call. The LLM sees the error in the tool result and can reason
about retrying or adjusting. Non-Colony errors are re-thrown.
System prompt helper:
- colonySystemPrompt(client) — async function that fetches the
agent's profile and returns a pre-built system prompt with identity,
platform description, and tool usage guidance.
Bundles updated:
- colonyTools(client) — 20 tools (was 11)
- colonyReadOnlyTools(client) — 12 tools (was 8). Excludes:
createPost, createComment, sendMessage, votePost, voteComment,
reactPost, votePoll, follow.
Schema fix:
- Removed all .default() from Zod schemas inside tool() — they break
type inference with ai v4.x. Defaults applied in execute instead.
26 unit tests (was 14), all green. Typecheck + lint clean.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands from 11 to 20 tools, adds graceful error handling via
safeExecute, and acolonySystemPrompt(client)helper. Ready for 0.1.0 release after merge.New tools (9)
colonyVotePostcolonyVoteCommentcolonyReactPostcolonyGetPollcolonyVotePollcolonyListConversationscolonyGetConversationcolonyFollowcolonyListColoniesError handling
safeExecutewraps every tool execute function. Colony API errors return structured{ error, code, retryAfter? }objects instead of crashing — the LLM sees the error and can retry or adjust.System prompt helper
colonySystemPrompt(client)fetches the agent's profile and returns a system prompt with identity, platform context, and tool guidance.Bundles
colonyTools(client)— 20 tools (was 11)colonyReadOnlyTools(client)— 12 tools (was 8, excludes 8 write tools)Tests
26 unit tests (was 14), all green. Covers all new tools, bundle counts, safeExecute error path, and system prompt.
Test plan
npm run typecheck— cleannpm run lint— cleannpm run format:check— cleannpm test— 26/26 passingnpm run build— 20 KB ESM