From 868638afc00e43de778bc7fcefc138a519d001fb Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 19 Mar 2026 10:25:39 +0100 Subject: [PATCH] beads: add --id lookup to search_beads.sh --- mcptools/search_beads.sh | 18 +++++++++++++++++- skills/beads/SKILL.md | 8 +++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/mcptools/search_beads.sh b/mcptools/search_beads.sh index bf204ea..3b0c64e 100755 --- a/mcptools/search_beads.sh +++ b/mcptools/search_beads.sh @@ -2,22 +2,38 @@ # capabilities: beads # description: Search beads by id, title, or description content. Filters by scope derived from cwd. # Usage: search_beads.sh --mount --query +# search_beads.sh --mount --id set -euo pipefail MOUNT="" QUERY="" +BEAD_ID="" while [[ $# -gt 0 ]]; do case "$1" in --mount) MOUNT="$2"; shift 2 ;; --query) QUERY="$2"; shift 2 ;; + --id) BEAD_ID="$2"; shift 2 ;; *) echo "unknown argument: $1" >&2; exit 1 ;; esac done -if [ -z "$MOUNT" ] || [ -z "$QUERY" ]; then +if [ -z "$MOUNT" ]; then echo "usage: search_beads.sh --mount --query " >&2 + echo " search_beads.sh --mount --id " >&2 + exit 1 +fi + +# Direct ID lookup +if [ -n "$BEAD_ID" ]; then + 9p read "anvillm/beads/$MOUNT/$BEAD_ID/json" 2>/dev/null || echo "null" + exit 0 +fi + +if [ -z "$QUERY" ]; then + echo "usage: search_beads.sh --mount --query " >&2 + echo " search_beads.sh --mount --id " >&2 exit 1 fi diff --git a/skills/beads/SKILL.md b/skills/beads/SKILL.md index 062185e..0e00bb1 100644 --- a/skills/beads/SKILL.md +++ b/skills/beads/SKILL.md @@ -71,7 +71,13 @@ Search beads by id, title, or description (includes closed): Tool: execute_code tool: search_beads.sh args: ["--mount", "", "--query", ""] -sandbox: default +``` + +Lookup bead by ID: +``` +Tool: execute_code +tool: search_beads.sh +args: ["--mount", "", "--id", ""] ``` **Note:** `list_beads.sh` and `list_ready_beads.sh` only return open beads. To find closed beads, use `search_beads.sh`.