Skip to main content
Glama
Xuanwo

MCP Server for Apache OpenDAL™

by Xuanwo

get_info

Retrieve file metadata from Apache OpenDAL-backed storage services by specifying a resource URI.

Instructions

Get metadata of file in OpenDAL service

Args:
    uri: resource URI, e.g. mys3://path/to/file

Returns:
    File metadata information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYes

Implementation Reference

  • The 'get_info' tool handler function. It parses a URI using parse_uri(), calls resource.stat(path) to get file metadata, and returns formatted file information (name, size, type). Registered with @mcp.tool() decorator.
    # Get file metadata
    @mcp.tool()
    async def get_info(uri: str) -> str:
        """
        Get metadata of file in OpenDAL service
    
        Args:
            uri: resource URI, e.g. mys3://path/to/file
    
        Returns:
            File metadata information
        """
        logger.debug(f"Getting file info: {uri}")
        try:
            resource, path = parse_uri(uri)
            metadata = await resource.stat(path)
    
            result = f"File: {path}\n"
            result += f"Size: {metadata.content_length} bytes\n"
            result += f"Type: {metadata.content_type}\n"
    
            return result
        except Exception as e:
            logger.error(f"Failed to get file info: {e!s}")
            return f"Error: {e!s}"
  • The @mcp.tool() decorator on line 134 registers 'get_info' as an MCP tool.
    # Get file metadata
    @mcp.tool()
  • The stat() helper method on OpendalResource class, called by get_info to fetch file metadata via self.op.stat(path).
    async def stat(self, path: Union[str, os.PathLike]) -> Metadata:
        """Get metadata for a specific path"""
        logger.debug(f"Statting path: {path}")
        return await self.op.stat(path)
  • The parse_uri() helper function, called by get_info to parse a URI into an OpendalResource instance and path string.
    def parse_uri(uri: str) -> Tuple[OpendalResource, str]:
        """Parse a URI into a resource and path"""
        from urllib.parse import unquote, urlparse
    
        logger.debug(f"Parsing URI: {uri}")
        parsed = urlparse(uri)
    
        scheme = parsed.scheme
        path = parsed.netloc + parsed.path
        path = unquote(path)  # Decode URL-encoded characters
        return (OpendalResource(scheme), path)
Behavior2/5

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

Without annotations, the description should reveal behavioral traits but only mentions it returns metadata. It does not disclose potential side effects (read-only assumed), authorization needs, or error conditions, leaving the agent underinformed.

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 with clear sections for purpose, args, and returns. It avoids fluff but could include more detail on the return value. Still, it earns its brevity.

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

Completeness3/5

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

Given the simple tool with one parameter and no output schema, the description provides basic information. However, it fails to describe the format or contents of the returned metadata, leaving a gap for the agent.

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?

With 0% schema coverage, the description provides an example URI format for the 'uri' parameter, adding meaning beyond the bare schema type. However, it lacks details like allowed schemes or URI validation, so only partially compensates.

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

Purpose5/5

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

The description clearly states 'Get metadata of file', specifying a unique resource and operation. It distinguishes from sibling tools 'list' and 'read' by implying it returns metadata, not file listing or content.

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 on when to use this tool versus sibling tools like 'list' or 'read'. The description only states what it does, not in which context it is appropriate.

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/Xuanwo/mcp-server-opendal'

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