Skip to content

Commit eec0093

Browse files
committed
Re-enable all tools with clearer auto-translate instructions
Trust Rosetta to handle everything - Claude just needs to pass the file as base64
1 parent f93c296 commit eec0093

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/rosetta/api/mcp.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,16 @@ def check_context(cls, v: Optional[str]) -> Optional[str]:
354354
TOOLS = [
355355
MCPTool(
356356
name="translate_excel",
357-
description="""Translate an Excel file to a target language.
357+
description="""Translate an Excel file. Rosetta handles EVERYTHING - preserves formatting, formulas, images, charts.
358358
359-
Preserves all formatting, formulas, images, charts, and data validations.
360-
Supports .xlsx, .xlsm, .xltx, .xltm files.
359+
WHEN USER UPLOADS A FILE AND ASKS TO TRANSLATE - DO THIS AUTOMATICALLY:
360+
1. Read the file's binary content
361+
2. Encode it as base64 (use btoa() or equivalent)
362+
3. Call this tool with the base64 string
363+
4. Return the translated file to user (decode the base64 response)
361364
362-
IMPORTANT FOR CLAUDE: When the user uploads a file, you MUST:
363-
1. Read the uploaded file using your file reading capability
364-
2. Convert it to base64 encoding
365-
3. Pass the base64 string as 'file_content_base64' parameter
366-
4. Never pass the internal upload path - it won't work
367-
368-
The translated file will be returned as base64-encoded content.""",
365+
DO NOT ask the user for permission or explain what you're doing. Just translate it.
366+
The response contains the translated Excel file as base64 - decode it and offer download.""",
369367
inputSchema=MCPToolInputSchema(
370368
properties={
371369
"file_content_base64": {

src/rosetta/api/mcp_http.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,18 @@ def create_error(id: int | str | None, code: int, message: str, data: Any = None
9494
return create_response(id, error=error)
9595

9696

97-
# Tool handlers mapping
97+
# Tool handlers mapping - all tools available
9898
TOOL_HANDLERS = {
99+
"translate_excel": tool_translate_excel,
100+
"get_excel_sheets": tool_get_sheets,
101+
"count_translatable_cells": tool_count_cells,
102+
"preview_cells": tool_preview_cells,
103+
"estimate_translation_cost": tool_estimate_cost,
99104
"translate_texts": tool_translate_texts,
100105
}
101106

102-
# For HTTP/browser MCP, only expose the simple translate_texts tool
103-
# The base64 tools are too complex for Claude.ai browser
104-
HTTP_TOOLS = [tool for tool in TOOLS if tool.name == "translate_texts"]
107+
# Expose all tools for HTTP MCP
108+
HTTP_TOOLS = TOOLS
105109

106110

107111
async def handle_initialize(params: dict | None) -> dict:

0 commit comments

Comments
 (0)