Skip to content

feat: switch MCP tool responses to TOON output - #490

Merged
baleen37 merged 4 commits into
mainfrom
wip/databricks-devtools-toon-output
Feb 13, 2026
Merged

feat: switch MCP tool responses to TOON output#490
baleen37 merged 4 commits into
mainfrom
wip/databricks-devtools-toon-output

Conversation

@baleen37

@baleen37 baleen37 commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • switch Databricks DevTools MCP tool text serialization from JSON to TOON while preserving logical payload fields
  • add TOON semantic decode assertions in MCP tests and keep tool behavior checks green
  • document TOON output contract and example in plugin README
  • include prior branch commit for create-pr workflow simplification (feat(create-pr): split verify and sync workflows)

Test plan

  • cd plugins/databricks-devtools && bun run test -- tests/mcp/server.test.ts
  • cd plugins/databricks-devtools && bun run test
  • cd plugins/databricks-devtools && bun run typecheck
  • cd plugins/databricks-devtools && bun run build
  • "/Users/jito.hello/.claude/plugins/cache/baleen-plugins/me/5.21.2/skills/create-pr/scripts/check-conflicts.sh" main

Notes

  • This PR intentionally includes the existing branch commit:
    • feat(create-pr): split verify and sync workflows

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Tool results now use TOON (Token-Oriented Object Notation) format for improved readability and consistency.
    • Added automatic base branch synchronization for pull request management.
  • Documentation

    • Simplified and streamlined pull request creation workflow documentation with clearer step-by-step guidance.
  • Tests

    • Expanded test coverage for new output formats and synchronization functionality.

Test User and others added 4 commits February 13, 2026 23:42
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR introduces TOON (Token-Oriented Object Notation) encoding for databricks-devtools MCP tool responses and significantly restructures the create-pr skill with a simplified workflow. Changes include a new sync-with-base.sh script, rewritten conflict checking and PR status verification logic, and corresponding test updates.

Changes

Cohort / File(s) Summary
TOON Format Implementation
plugins/databricks-devtools/README.md, plugins/databricks-devtools/package.json, plugins/databricks-devtools/src/mcp/server.ts, plugins/databricks-devtools/tests/mcp/server.test.ts
Implements TOON encoding for MCP tool output serialization, replacing JSON.stringify with encode() function. Updated tests decode and validate TOON payloads with helper utilities.
Create-PR Skill Documentation
plugins/me/skills/create-pr/SKILL.md
Comprehensively restructured documentation from multi-step guarded workflow to simplified linear flow emphasizing minimal, deterministic steps with clearer status handling.
Create-PR Scripts
plugins/me/skills/create-pr/scripts/check-conflicts.sh, plugins/me/skills/create-pr/scripts/verify-pr-status.sh, plugins/me/skills/create-pr/scripts/sync-with-base.sh
Simplified conflict checking with plain-text output, rewrote verify-pr-status with streamlined state machine, and added new sync-with-base.sh script for branch synchronization.
Test Suite Updates
plugins/me/tests/me-specific.bats, tests/skills/test_check_conflicts.bats, tests/skills/test_create_pr_verify_status.bats
Added tests for new sync-with-base.sh script, removed color escape sequence validation, and refactored script path references to VERIFY_SCRIPT and SYNC_SCRIPT variables.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 The workflows now sing so lean and light,
TOON encodes the output just right,
Scripts simplified, conflicts in plain sight,
A syncing branch dancing through the night,
Status checks swift—no delay, no plight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (21 files):

⚔️ .claude-plugin/marketplace.json (content)
⚔️ plugins/conversation-memory/.claude-plugin/plugin.json (content)
⚔️ plugins/databricks-devtools/.claude-plugin/plugin.json (content)
⚔️ plugins/databricks-devtools/README.md (content)
⚔️ plugins/databricks-devtools/bun.lock (content)
⚔️ plugins/databricks-devtools/package.json (content)
⚔️ plugins/databricks-devtools/src/mcp/server.ts (content)
⚔️ plugins/databricks-devtools/tests/mcp/server.test.ts (content)
⚔️ plugins/git-guard/.claude-plugin/plugin.json (content)
⚔️ plugins/handoff/.claude-plugin/plugin.json (content)
⚔️ plugins/jira/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-bash/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-go/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-kotlin/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-lua/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-nix/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-python/.claude-plugin/plugin.json (content)
⚔️ plugins/lsp-typescript/.claude-plugin/plugin.json (content)
⚔️ plugins/me/.claude-plugin/plugin.json (content)
⚔️ plugins/ralph-loop/.claude-plugin/plugin.json (content)
⚔️ plugins/suggest-compacting/.claude-plugin/plugin.json (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: switching MCP tool responses from JSON to TOON output format.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wip/databricks-devtools-toon-output
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch wip/databricks-devtools-toon-output
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@plugins/me/skills/create-pr/scripts/verify-pr-status.sh`:
- Around line 23-26: The script currently calls gh pr view to populate PR_URL
and PR_STATUS (used to derive MERGEABLE and STATE) without handling gh failing
(no open PR), so wrap the gh pr view calls with a guard: run gh pr view --json
url -q .url and gh pr view --json mergeable,mergeStateStatus in a conditional
(or capture their exit codes), and if either fails or returns empty set
PR_URL/PR_STATUS, print a clear friendly error like "No open PR for current
branch" and exit with non-zero status; update references to PR_URL, PR_STATUS,
MERGEABLE, and STATE accordingly so downstream logic only runs when these
variables are valid.

In `@plugins/me/skills/create-pr/SKILL.md`:
- Around line 19-42: The heading "## Minimal Workflow (/writing-skills)" is
using the wrong path; update the heading string in SKILL.md by replacing
"(/writing-skills)" with the correct skill path such as "(/create-pr)" or remove
the path entirely so it reads "## Minimal Workflow"; locate and edit the heading
line containing "## Minimal Workflow (/writing-skills)" to apply the fix.
🧹 Nitpick comments (6)
plugins/databricks-devtools/src/mcp/server.ts (1)

42-52: Clean refactoring from JSON to TOON encoding.

The payload construction and encode() call are straightforward. One consideration: this is a breaking change for any downstream consumers that previously parsed JSON from these tool responses. If there are external integrations or clients that call these tools and JSON.parse() the result, they'll break silently.

Ensure any consumers outside of this plugin (e.g., other plugins, scripts, or agents) are aware of the format change, or consider a transitional approach (e.g., a query parameter or header to opt into TOON).

plugins/databricks-devtools/tests/mcp/server.test.ts (1)

69-82: Solid round-trip semantic validation.

This test verifies that decode(encode(payload)) preserves all fields, which is the critical correctness guarantee for the format migration.

One minor note: the tests only cover listCatalogsTool. Consider adding at least one TOON-decode assertion for a tool with a multi-row result (e.g., listTablesTool with multiple tables) to exercise TOON's tabular encoding path more thoroughly.

plugins/me/skills/create-pr/scripts/sync-with-base.sh (2)

12-26: Consider reordering: git-repo check before gh CLI call.

The gh repo view call on line 14 happens before verifying we're inside a git repository (line 23). If a user omits the base-branch argument and isn't in a git repo, gh repo view will likely fail (caught by || true), then the "Cannot determine default branch" error fires — which is a misleading message when the real problem is "not in a git repo." Moving the git-repo guard above the gh fallback would give a clearer error.

Proposed reorder
 BASE="${1:-}"
+
+if ! git rev-parse --git-dir >/dev/null 2>&1; then
+  echo "ERROR: Not in a git repository" >&2
+  exit 2
+fi
+
 if [[ -z "$BASE" ]]; then
   BASE=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo "")
-  if [[ -z "$BASE" ]]; then
-    echo "ERROR: Cannot determine default branch" >&2
-    echo "  - Pass base branch explicitly: $0 <base-branch>" >&2
-    echo "  - Or ensure 'gh' CLI is authenticated" >&2
-    exit 2
-  fi
 fi
-
-if ! git rev-parse --git-dir >/dev/null 2>&1; then
-  echo "ERROR: Not in a git repository" >&2
+if [[ -z "$BASE" ]]; then
+  echo "ERROR: Cannot determine default branch" >&2
+  echo "  - Pass base branch explicitly: $0 <base-branch>" >&2
+  echo "  - Or ensure 'gh' CLI is authenticated" >&2
   exit 2
 fi

34-46: Conflict/failure messages go to stdout — intentional?

Lines 37–45 (conflict summary and resolution steps) are printed to stdout, while similar guidance in check-conflicts.sh goes to stderr. If these scripts are composed in pipelines or their stdout is captured, the conflict detail will mix into the data stream. Consider sending at least the "✗ Merge failed" line to stderr for consistency.

plugins/me/skills/create-pr/scripts/check-conflicts.sh (1)

12-26: Same reorder opportunity as sync-with-base.sh: git-repo check before gh call.

This is the same pattern — gh repo view runs before verifying we're in a git repository. The same reordering suggestion from sync-with-base.sh applies here for clearer error messages.

plugins/me/skills/create-pr/scripts/verify-pr-status.sh (1)

23-30: Three separate gh pr view calls could be consolidated.

Lines 23, 24, and 30 each make a separate GitHub API call. The first two could be combined into one (--json url,mergeable,mergeStateStatus), and the third (statusCheckRollup) could also be folded in if the slight over-fetch for non-CLEAN states is acceptable. This reduces API round-trips and avoids potential rate-limiting in CI.

Possible consolidation
-PR_URL=$(gh pr view --json url -q .url)
-PR_STATUS=$(gh pr view --json mergeable,mergeStateStatus)
-MERGEABLE=$(echo "$PR_STATUS" | jq -r .mergeable)
-STATE=$(echo "$PR_STATUS" | jq -r .mergeStateStatus)
+PR_JSON=$(gh pr view --json url,mergeable,mergeStateStatus,statusCheckRollup)
+PR_URL=$(echo "$PR_JSON" | jq -r .url)
+MERGEABLE=$(echo "$PR_JSON" | jq -r .mergeable)
+STATE=$(echo "$PR_JSON" | jq -r .mergeStateStatus)

Then inside the CLEAN) branch, extract checks from the already-fetched data:

-    CHECKS=$(gh pr view --json statusCheckRollup -q '.statusCheckRollup')
+    CHECKS=$(echo "$PR_JSON" | jq '.statusCheckRollup')

Comment on lines 23 to 26
PR_URL=$(gh pr view --json url -q .url)
PR_STATUS=$(gh pr view --json mergeable,mergeStateStatus)
MERGEABLE=$(echo "$PR_STATUS" | jq -r .mergeable)
STATE=$(echo "$PR_STATUS" | jq -r .mergeStateStatus)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

No guard if gh pr view fails (e.g., no open PR).

Under set -euo pipefail, if there's no PR associated with the current branch, gh pr view on line 23 will fail and the script will exit with gh's raw error — no friendly message. A brief guard would improve UX.

Proposed guard
+if ! PR_URL=$(gh pr view --json url -q .url 2>/dev/null); then
+  echo "ERROR: No open PR found for this branch" >&2
+  echo "  - Create a PR first: gh pr create" >&2
+  exit 1
+fi
-PR_URL=$(gh pr view --json url -q .url)
-PR_STATUS=$(gh pr view --json mergeable,mergeStateStatus)
+PR_STATUS=$(gh pr view --json mergeable,mergeStateStatus)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PR_URL=$(gh pr view --json url -q .url)
PR_STATUS=$(gh pr view --json mergeable,mergeStateStatus)
MERGEABLE=$(echo "$PR_STATUS" | jq -r .mergeable)
STATE=$(echo "$PR_STATUS" | jq -r .mergeStateStatus)
if ! PR_URL=$(gh pr view --json url -q .url 2>/dev/null); then
echo "ERROR: No open PR found for this branch" >&2
echo " - Create a PR first: gh pr create" >&2
exit 1
fi
PR_STATUS=$(gh pr view --json mergeable,mergeStateStatus)
MERGEABLE=$(echo "$PR_STATUS" | jq -r .mergeable)
STATE=$(echo "$PR_STATUS" | jq -r .mergeStateStatus)
🤖 Prompt for AI Agents
In `@plugins/me/skills/create-pr/scripts/verify-pr-status.sh` around lines 23 -
26, The script currently calls gh pr view to populate PR_URL and PR_STATUS (used
to derive MERGEABLE and STATE) without handling gh failing (no open PR), so wrap
the gh pr view calls with a guard: run gh pr view --json url -q .url and gh pr
view --json mergeable,mergeStateStatus in a conditional (or capture their exit
codes), and if either fails or returns empty set PR_URL/PR_STATUS, print a clear
friendly error like "No open PR for current branch" and exit with non-zero
status; update references to PR_URL, PR_STATUS, MERGEABLE, and STATE accordingly
so downstream logic only runs when these variables are valid.

Comment on lines +19 to 42
## Minimal Workflow (/writing-skills)

```bash
# Check current state
# 1) pre-flight
git status
git log --oneline -5
git branch --show-current
git log --oneline -5

# Block if on main/master
# Block if no changes (working tree clean)
```

### Commit

```bash
# Stage specific files only (never -A)
# 2) commit
git add <specific-files>
git commit -m "type(scope): description"
```
git commit -m "type(scope): summary"

### Conflict Check (REQUIRED)

```bash
# 3) conflict check (read-only)
"${CLAUDE_PLUGIN_ROOT}/skills/create-pr/scripts/check-conflicts.sh"
```

Exits with:
- `0` - No conflicts, safe to proceed
- `1` - Conflicts detected, manual resolution required
- `2` - Error (missing branch, git errors)

### Push

```bash
# 4) push
git push -u origin HEAD
```

### Create PR
# 5) create PR (do not hardcode --base main)
gh pr create --title "$(git log -1 --pretty=%s)" --body "<summary, details, tests>"

```bash
gh pr create --title "$(git log -1 --pretty=%s)" --body "<comprehensive description>"
# 6) verify (read-only)
"${CLAUDE_PLUGIN_ROOT}/skills/create-pr/scripts/verify-pr-status.sh"
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the “/writing-skills” path in the heading.
This looks like a stray or incorrect path reference for this skill doc.

✏️ Suggested tweak
-## Minimal Workflow (/writing-skills)
+## Minimal Workflow
🤖 Prompt for AI Agents
In `@plugins/me/skills/create-pr/SKILL.md` around lines 19 - 42, The heading "##
Minimal Workflow (/writing-skills)" is using the wrong path; update the heading
string in SKILL.md by replacing "(/writing-skills)" with the correct skill path
such as "(/create-pr)" or remove the path entirely so it reads "## Minimal
Workflow"; locate and edit the heading line containing "## Minimal Workflow
(/writing-skills)" to apply the fix.

@baleen37
baleen37 merged commit c463c8b into main Feb 13, 2026
5 checks passed
@baleen37
baleen37 deleted the wip/databricks-devtools-toon-output branch February 13, 2026 16:13
baleen-release-app Bot pushed a commit that referenced this pull request Feb 13, 2026
# [5.23.0](v5.22.0...v5.23.0) (2026-02-13)

### Features

* switch MCP tool responses to TOON output ([#490](#490)) ([c463c8b](c463c8b))
baleen37 pushed a commit to baleen37/memmem that referenced this pull request Feb 15, 2026
# [5.23.0](baleen37/bstack@v5.22.0...v5.23.0) (2026-02-13)

### Features

* switch MCP tool responses to TOON output ([#490](baleen37/bstack#490)) ([c463c8b](baleen37/bstack@c463c8b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant