Skip to main content
Glama

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
NameRequiredDescriptionDefault
from_idYesYour instance ID
to_idYesTarget instance ID
filepathYesPath to file to share
descriptionNoDescription of the file

Implementation Reference

  • 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}")]
  • 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"]
        }
    ),
  • 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"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions sharing file content but doesn't specify permissions required, whether the operation is read-only or destructive, rate limits, or what happens on success/failure. This leaves significant gaps for a tool that likely involves data transfer between instances.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on behavioral traits, error handling, and output expectations, making it incomplete for safe and effective use by an AI agent in a multi-instance environment.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters (from_id, to_id, filepath, description). The description adds no additional meaning beyond what's in the schema, such as format examples or constraints, but the baseline is 3 since the schema provides adequate parameter information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('share') and resource ('file content'), specifying it's between instances. However, it doesn't distinguish this tool from sibling tools like 'send' or 'broadcast', which might have similar sharing functionality but different scopes or methods.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'send' or 'broadcast'. The description implies a specific context (sharing between instances), but it doesn't clarify prerequisites, exclusions, or comparative use cases with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jdez427/claude-ipc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server