Skip to main content
Glama
Xuanwo

MCP Server for Apache OpenDAL™

by Xuanwo

read

Extracts file content from storage services like S3, Azure Blob Storage, and Google Cloud Storage using a specified URI, returning the content or error details.

Instructions

Read file content from OpenDAL service Args: uri: resource URI, e.g. mys3://path/to/file Returns: File content or error information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYes

Implementation Reference

  • The main handler function for the 'read' MCP tool. It parses the input URI, retrieves the appropriate OpenDAL resource, calls the opendal_resource template to read the file content and metadata, formats the response (text or base64-encoded binary), and handles errors.
    async def read(uri: str) -> Dict[str, Any]: """ Read file content from OpenDAL service Args: uri: resource URI, e.g. mys3://path/to/file Returns: File content or error information """ logger.debug(f"Reading file content: {uri}") try: resource, path = parse_uri(uri) # Directly call the resource function to get content return await opendal_resource(resource.scheme, path) except Exception as e: logger.error(f"Failed to read file content: {e!s}") return {"error": str(e)}

Other Tools

Related 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