Skip to main content
Glama
masx200
by masx200

webdav_get_remote_file

Retrieve content from files stored on remote WebDAV servers by specifying the file path, enabling access to remote file data through simple path-based requests.

Instructions

Retrieve content from a file stored on a remote WebDAV server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • MCP server.tool call that registers the webdav_get_remote_file tool, provides its description, input schema using Zod, and defines the inline execution handler.
    server.tool(
      "webdav_get_remote_file",
      "Retrieve content from a file stored on a remote WebDAV server",
      {
        path: z.string().min(1, "Path must not be empty"),
      },
      async ({ path }) => {
        try {
          const content = await webdavService.readFile(path);
    
          return {
            content: [{
              type: "text",
              text: content,
            }],
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error reading file: ${(error as Error).message}`,
            }],
            isError: true,
          };
        }
      },
    );
  • The WebDAVService.readFile method implements the core file reading logic using WebDAVClient.getFileContents with text format, handles response formats, and includes logging and error handling. This is called by the tool handler.
    async readFile(path: string): Promise<string> {
      const fullPath = this.getFullPath(path);
      logger.debug(`Reading file: ${fullPath}`);
    
      try {
        // v5.x returns buffer by default, need to use format: 'text'
        const content = await this.client.getFileContents(fullPath, {
          format: "text",
        });
    
        // Handle both direct string response and detailed response
        let result: string;
        if (typeof content === "string") {
          result = content;
        } else if (this.isResponseData(content)) {
          result = String(content.data);
        } else {
          throw new Error("Unexpected response format from server");
        }
    
        const contentLength = result.length;
        logger.debug(`Read file: ${fullPath}`, { contentLength });
        return result;
      } catch (error) {
        logger.error(`Error reading file ${fullPath}:`, error);
        throw new Error(`Failed to read file: ${(error as Error).message}`);
      }
    }
  • src/lib.ts:79-79 (registration)
    Top-level call to setupToolHandlers which registers all WebDAV tools, including webdav_get_remote_file, on the MCP server instance.
    setupToolHandlers(server, webdavService);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Retrieve content') but doesn't mention authentication requirements, rate limits, error conditions, or what 'retrieve' entails (e.g., full file download, streaming). This leaves significant gaps for a tool interacting with remote servers.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 complexity of remote file operations, no annotations, no output schema, and 0% schema coverage, the description is incomplete. It doesn't address authentication, error handling, return format, or differentiation from sibling tools, leaving the agent with insufficient context for reliable use.

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 has 0% description coverage for the single parameter 'path', and the tool description doesn't mention parameters at all. Since there's only one parameter, the baseline is 4, but the description fails to add any semantic context about what 'path' represents (e.g., absolute path, URL format, encoding requirements), so it's scored lower at 3.

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 ('Retrieve content') and resource ('from a file stored on a remote WebDAV server'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'webdav_read_remote_file' or 'webdav_range_request', which likely have overlapping functionality.

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. With multiple sibling tools for reading files (e.g., 'webdav_read_remote_file', 'webdav_range_request', 'webdav_read_multiple_files'), there's no indication of when this specific retrieval method is preferred or what distinguishes it.

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/masx200/mcp-webdav-server'

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