share_file
Transfer file content between Claude AI instances using Inter-Process Communication to enable collaborative workflows and data sharing.
Instructions
Share file content with another instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_id | Yes | Your instance ID | |
| to_id | Yes | Target instance ID | |
| filepath | Yes | Path to file to share | |
| description | No | Description of the file |
Implementation Reference
- src/claude_ipc_server.py:1166-1195 (handler)Handler for the 'share_file' tool. Reads the content of the specified file and sends it to the target instance via the IPC broker's 'send' action, including file metadata in the message data.elif name == "share_file": if not current_session_token: return [TextContent(type="text", text="Error: Not registered. Please register first.")] try: with open(arguments["filepath"], 'r') as f: content = f.read() message = { "content": f"Shared file: {arguments['filepath']}", "data": { "type": "file", "filepath": arguments["filepath"], "content": content, "description": arguments.get("description", "") } } response = BrokerClient.send_request({ "action": "send", "from_id": arguments["from_id"], "to_id": arguments["to_id"], "message": message, "session_token": current_session_token }) return [TextContent(type="text", text=f"File shared: {json.dumps(response, indent=2)}")] except Exception as e: return [TextContent(type="text", text=f"Error sharing file: {e}")]
- src/claude_ipc_server.py:994-1018 (registration)Registration of the 'share_file' tool in the MCP server's list_tools() function, including name, description, and input schema.name="share_file", description="Share file content with another instance", inputSchema={ "type": "object", "properties": { "from_id": { "type": "string", "description": "Your instance ID" }, "to_id": { "type": "string", "description": "Target instance ID" }, "filepath": { "type": "string", "description": "Path to file to share" }, "description": { "type": "string", "description": "Description of the file" } }, "required": ["from_id", "to_id", "filepath"] } ),
- src/claude_ipc_server.py:996-1017 (schema)Input schema definition for the 'share_file' tool, specifying parameters: from_id, to_id, filepath (required), and optional description.inputSchema={ "type": "object", "properties": { "from_id": { "type": "string", "description": "Your instance ID" }, "to_id": { "type": "string", "description": "Target instance ID" }, "filepath": { "type": "string", "description": "Path to file to share" }, "description": { "type": "string", "description": "Description of the file" } }, "required": ["from_id", "to_id", "filepath"] }