Skip to main content
Glama
iijimam

RAGandLLM-MCP

by iijimam

upload_file

Upload fish images to identify species and receive fish names with corresponding IDs for documentation and classification purposes.

Instructions

魚の画像を渡すと魚名が返ります。補足情報として魚IDも返ります。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesアップロードする魚画像ファイル名フルパス(例: c: emp ish.jpg)で指定します。応答はJSONで返送され、FishID、FishName、が返ります。

Implementation Reference

  • The core handler function for the 'upload_file' tool. It opens the specified file, sends it via HTTP POST to the API endpoint, and returns the JSON response containing fish identification data.
    async def upload_file(filename: str):
        file = {'fish': open(filename, 'rb')}
        async with httpx.AsyncClient(timeout=60.0,verify=False) as client:
            response = await client.post(
                f"{API_BASE_URL}/upload",files=file
            )
            response.raise_for_status()
            data = response.json()
            return data
  • JSON Schema defining the input parameters for the 'upload_file' tool, specifying that 'filename' is a required string.
    inputSchema={
        "type": "object",
        "properties": {
            "filename": {
                "type": "string",
                "description": "アップロードする魚画像ファイル名フルパス(例: c:\temp\fish.jpg)で指定します。応答はJSONで返送され、FishID、FishName、が返ります。"
            }
        },
        "required": ["filename"]
    }
  • Registers the 'upload_file' tool in the MCP server's list_tools handler, providing name, description, and schema.
    types.Tool(
        name="upload_file",
        description="魚の画像を渡すと魚名が返ります。補足情報として魚IDも返ります。",
        inputSchema={
            "type": "object",
            "properties": {
                "filename": {
                    "type": "string",
                    "description": "アップロードする魚画像ファイル名フルパス(例: c:\temp\fish.jpg)で指定します。応答はJSONで返送され、FishID、FishName、が返ります。"
                }
            },
            "required": ["filename"]
        }
    ),
  • Dispatch logic in the call_tool handler that invokes the upload_file function based on tool name, handles arguments, calls the tool, and formats success/error responses.
    if name == "upload_file":
    
        if not isinstance(arguments, dict):
            raise ValueError("Invalid forecast arguments")
        
        file=arguments["filename"]
        try:
            answer= await upload_file(file)
            print(answer)
            logger.info(f"answer is : {answer}")
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(answer,ensure_ascii=False, indent=2)
                )
            ]
        except Exception as e:
            error_details = {
                "error_type": type(e).__name__,
                "error_message": str(e),
            }
            return [
                types.TextContent(
                    type="text",
                    text=f"エラーが発生しました(upload): {json.dumps(error_details, ensure_ascii=False, indent=2)}"
                )
            ]
        except httpx.HTTPError as e:
            logger.error(f"IRIS API error: {str(e)}")
            return [
            types.TextContent(
                type="text",
                text=f"エラーが発生しました(upload): {str(e)}"
            )
            ]
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that fish names and IDs are returned, but doesn't describe error handling, file format requirements, size limits, authentication needs, or rate limits. For a tool that processes images and returns data, this leaves significant behavioral gaps.

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

Conciseness4/5

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

The description is concise and front-loaded with the main purpose in the first sentence. The second sentence adds useful supplementary information about return values. Both sentences earn their place, though it could be slightly more structured (e.g., separating purpose from return details more clearly).

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?

Given the tool's complexity (image processing and identification), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like error conditions, file requirements, or response format details beyond mentioning JSON. For a tool with no structured safety or output information, more context is needed.

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?

The schema description coverage is 100%, with the parameter 'filename' fully documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., no additional context about image formats or constraints). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't need to.

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 tool's purpose: '魚の画像を渡すと魚名が返ります' (when you pass a fish image, it returns the fish name). It specifies the verb (upload/process image) and resource (fish identification), though it doesn't explicitly differentiate from sibling tools like 'get_recipe' or 'register_choka'. The purpose is clear but lacks sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, when not to use it, or how it differs from sibling tools like 'get_recipe' or 'register_choka'. The only implied usage is for fish image identification, but no explicit alternatives or context is provided.

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/iijimam/RAGandLLM-MCP'

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