Skip to main content
Glama
iamvinitk
by iamvinitk

Read a file under the app's userData dir

read_user_data_file

Read a file from Electron's userData directory safely, with path-traversal protection. Returns text content and resolved absolute path.

Instructions

Safely read a file relative to the session's app.getPath('userData') (e.g. config.json, api-logs/api.log). Path-traversal protected: paths are resolved against userData and rejected if they escape it. Returns the text content (up to the size cap) along with the resolved absolute path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesSession id.
relPathYesPath relative to `userData`, e.g. `config.json` or `api-logs/2026-05-08.log`.
maxBytesNoRead cap in bytes (default 1 MB).
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It discloses path-traversal protection, size cap, and return fields. However, it does not mention error behavior (e.g., file not found) or encoding, leaving gaps in behavioral understanding.

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?

Two sentences, no filler. The first sentence states purpose and location; the second covers protections and return. Perfectly front-loaded and efficient.

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

Completeness4/5

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

Given no output schema, the description explains the return (text content and resolved path). It covers safety and size limits. It lacks error handling details, but for a simple read tool, it is reasonably complete.

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?

Schema coverage is 100% with clear param descriptions. The description adds value by giving examples of relPath values (config.json, api-logs/...) and explaining the maxBytes default. This goes beyond the schema's basic descriptions.

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 states the specific verb 'read' and resource 'file under userData', with examples like 'config.json'. It clearly distinguishes from sibling tools because no other tool reads files from userData.

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 gives no explicit guidance on when to use this tool versus alternatives, nor does it mention when not to use it. There is no mention of prerequisites or exclusions.

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/iamvinitk/electron-mcp'

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