Thin Telegram transport layer for Claude Code with MCP tool integration for browser automation, page interaction, and translation
Babata's 12 tools are well-named with action verbs (tab_*, dom_*, page_*, article_*, translate, suggest_prompts, mascot_speak) and comprehensive descriptions (avg ~180 chars, well above 34-char baseline). All tools have explicit input schemas with typed properties and descriptions. However, output schemas are entirely undocumented, no tool declares what fields it returns, forcing LLMs to infer structure. Parameter descriptions are strong but lack explicit constraints (enums, ranges, patterns). Error handling is minimal; tools return {ok}/{count} but provide no recovery guidance. Security is reasonable (no exposed secrets in params) but lacks permission gates and audit trail declarations.
Extract the main readable article/content from V's current tab. Returns url/title/site metadata, paragraph list with ids, plain text with [pN] anchors, markdown, char_count, and extraction_method. Use when you decide the user's question needs the page's original text; do not use shell/curl to read the current tab.
Synthetic .click() on first match. Returns {ok}. NOTE: synthetic (not isTrusted=true); some captcha-protected / OAuth buttons won't fire. If that happens, report the limitation instead of claiming trusted input.
insertAdjacentHTML on every element matching selector. position: beforebegin | afterbegin | beforeend (default) | afterend. Use for explicit page annotations or small UI helpers when V asks for page modification. Automatic page translation is handled by the content script /translate path, not this tool. Returns {count}.
querySelectorAll on V's active tab, return per-element prop list. selector default 'body'. props default ['tag','text']; available: tag / id / class / text (innerText, capped 1500) / html (innerHTML, capped 2000) / href / value / name / type / placeholder / rect (x/y/w/h px) / attrs (full attribute map). Use 'root' (selector) to scope querying inside one ancestor. limit caps result count (default 50).
Set property on every match. prop: value (sets input/textarea + fires input/change events) | textContent | <any attribute name>. Use for filling forms or explicit page edits. Automatic page translation is handled by the content script /translate path, not this tool. Returns {count}.
No output schemas documented. Tools return {ok}, {count}, {snapshot_id, ...}, etc., but LLMs cannot plan downstream calls without knowing response structure. Every tool must declare its return type.
Parameters lack explicit constraints. 'limit' has no min/max (dom_query, page_snapshot). 'position' in dom_inject has enum but others like 'selector' accept free-form strings with no validation hints. Add ranges and patterns to descriptions.
Error handling is minimal. Tools return {ok} or {count} on success but provide no recovery guidance on failure. E.g., dom_click notes synthetic clicks may fail on captcha but offers no fallback. Add actionable error messages and retry guidance.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 57 | <=2025-11-25 | v2 |
Make the babata mascot float a speech bubble on V's current page (content widget Shadow DOM). Use sparingly — only when you have a genuine insight to share.
Click an element by ref from a previous page_snapshot. Required: snapshot_id and ref (e.g. e3). Uses the stored selector on the same tab, scrolls it into view, focuses if possible, then synthetic .click(). Returns {ok, selector, rect} or a stale-ref error.
Build a compact visible-page map for the target tab. Returns {snapshot_id, tab_id, window_id, url, title, items, lines}. Each item has ref/role/tag/name/selector/rect/is_new. Prefer this before clicking or reasoning about page UI; is_new compares with the previous snapshot for the same tab.
Push prediction chips to the sidepanel UI. After reading a page / answering V's question, you may forecast 1–2 likely follow-up prompts (e.g. '总结全文' / '提取人物关系' / '帮我填表'). UI renders them as click-to-send chips. Don't over-suggest — only when you genuinely predict V's next move; empty list clears.
Read current active tab's meta (url / title / current selection / scrollY / docHeight / lang). Lightweight — no DOM extraction. Use to verify what V is looking at before deciding whether to compose dom_query for content. Pass tab_id/window_id from page_context to avoid racing V's active tab.
Navigate the target tab to url. Returns {ok, tab_id, url}.
Translate plain text to target_lang (default zh) using the sidebar translation backend. Pure text tool: no DOM read, no DOM injection, no page side effect. Use when V asks to translate text or when you need a translation before deciding how to answer.
No permission gates or scope declarations. Tools like dom_inject, dom_set, dom_click, tab_navigate are destructive but lack permission checks or audit trail declarations. Add scope requirements (e.g., 'write:page', 'read:page').
suggest_prompts and mascot_speak lack clear use-case guidance. When should an LLM call suggest_prompts vs. just answering? When is mascot_speak appropriate? Descriptions are vague ('sparingly', 'genuine insight'). Add concrete decision criteria.