Skip to main content
Glama
fredriksknese

mcp-openmediavault

get_mounted_filesystems

Retrieve mounted filesystems and usage statistics to monitor storage capacity and manage disk space on OpenMediaVault NAS systems.

Instructions

Get all currently mounted filesystems with their usage statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for get_mounted_filesystems tool. It calls client.rpc with FileSystemMgmt.enumerateMountedFilesystems and returns the result as formatted JSON, with error handling.
    async () => {
      try {
        const result = await client.rpc(
          "FileSystemMgmt",
          "enumerateMountedFileSystems",
          {},
        );
        return toolResult(JSON.stringify(result, null, 2));
      } catch (error) {
        return toolResult(
          `Error fetching mounted filesystems: ${error}`,
          true,
        );
      }
    },
  • Tool registration using server.tool() with name 'get_mounted_filesystems', description, empty schema (no parameters), and the handler function.
    server.tool(
      "get_mounted_filesystems",
      "Get all currently mounted filesystems with their usage statistics",
      {},
      async () => {
        try {
          const result = await client.rpc(
            "FileSystemMgmt",
            "enumerateMountedFileSystems",
            {},
          );
          return toolResult(JSON.stringify(result, null, 2));
        } catch (error) {
          return toolResult(
            `Error fetching mounted filesystems: ${error}`,
            true,
          );
        }
      },
    );
  • Empty schema object {} indicating this tool requires no input parameters.
    {},
  • toolResult helper function that formats the response as MCP content with type 'text', supporting both success and error cases.
    function toolResult(text: string, isError = false) {
      return { content: [{ type: "text" as const, text }], isError };
    }
  • OmvClient.rpc method that performs the actual HTTP POST to OpenMediaVault's RPC endpoint. Handles authentication, session management, and error handling for API calls.
    async rpc(
      service: string,
      method: string,
      params: Record<string, unknown> = {},
    ): Promise<unknown> {
      if (!this.sessionId && !this.cookie) {
        await this.login();
      }
    
      const url = `${this.baseUrl}/rpc.php`;
      const body = {
        service,
        method,
        params,
        options: null,
      };
    
      const headers: Record<string, string> = {
        "Content-Type": "application/json",
      };
    
      if (this.cookie) {
        headers["Cookie"] = this.cookie;
      }
      if (this.sessionId) {
        headers["X-OPENMEDIAVAULT-SESSIONID"] = this.sessionId;
      }
    
      const response = await fetch(url, {
        method: "POST",
        headers,
        body: JSON.stringify(body),
      });
    
      if (response.status === 401) {
        // Session expired — re-login and retry
        await this.login();
        return this.rpc(service, method, params);
      }
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`OMV API error (${response.status}): ${errorText}`);
      }
    
      const data = (await response.json()) as OmvResponse;
    
      if (data.error) {
        throw new Error(
          `OMV RPC error [${service}.${method}]: ${data.error.message} (code ${data.error.code})`,
        );
      }
    
      return data.response;
    }
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 'usage statistics' but doesn't specify what these include (e.g., disk space, inodes, mount points) or any operational details like performance impact, permissions required, or output format. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 any unnecessary words. It is front-loaded and appropriately sized, making it easy to parse quickly.

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 tool's complexity (simple read operation with no parameters) and the absence of annotations and output schema, the description is minimally adequate. It specifies the resource and includes 'usage statistics', but without annotations or output schema, it doesn't fully cover behavioral aspects or return values, leaving room for improvement in completeness.

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

Parameters4/5

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

The tool has 0 parameters, and the input schema has 100% description coverage with no properties. The description doesn't need to add parameter semantics, so it meets the baseline of 4 for tools with no parameters, as there's nothing to compensate for.

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 verb 'Get' and the resource 'all currently mounted filesystems with their usage statistics', making the purpose specific and understandable. It doesn't explicitly differentiate from sibling tools like 'list_filesystems', but the inclusion of 'usage statistics' provides some distinction. This is clear but lacks explicit 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, such as 'list_filesystems' or 'list_disks' among the siblings. There is no mention of prerequisites, context, or exclusions. It simply states what the tool does without indicating when it's 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/fredriksknese/mcp-openmediavault'

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