Skip to main content
Glama
oemoem12

lmstudio-agent-mcp

by oemoem12

agent_read_file

Read-onlyIdempotent

Read text file contents with line offset, limit, and encoding options. Returns JSON with path, total lines, truncated flag, and content.

Instructions

Read the contents of a text file.

Returns a JSON object with the file path, requested offset/limit, and the lines that were read. Large files are capped at MAX_FILE_SIZE bytes.

Args: path: Absolute or relative path to the file. offset: Number of lines to skip from the beginning. limit: Maximum number of lines to return (null = unlimited). encoding: Text encoding to use.

Returns: str: JSON string with keys 'success', 'path', 'offset', 'limit', 'total_lines', 'truncated', and 'content'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the file to read.
limitNoMaximum number of lines to return (null = unlimited).
offsetNoNumber of lines to skip from the beginning.
encodingNoText encoding to use when reading the file.utf-8

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already mark this as read-only and idempotent. The description adds valuable context: files are capped at MAX_FILE_SIZE, the tool returns a JSON object with specific keys, and offset/limit control line selection. This goes beyond simple safety hints.

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 well-structured with sections for purpose, arguments, and returns. It is front-loaded with the primary action. While the Args section duplicates schema information, it is not overly verbose and every part serves a purpose, making it reasonably concise.

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 the output schema exists and annotations are present, the description covers essential behavioral details: MAX_FILE_SIZE cap, JSON return structure, and parameter semantics. It does not elaborate on error cases or exact MAX_FILE_SIZE value, but for a simple read tool this is sufficient and complete enough for invocation.

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 input schema already provides 100% coverage of all four parameters with descriptions. The description's 'Args' section largely repeats the schema, adding no new semantic information beyond what the schema already states. Baseline of 3 is appropriate given full schema coverage.

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 'Read the contents of a text file' with a specific verb and resource. It also outlines the return format and key parameters (path, offset, limit, encoding), making it easy to distinguish from sibling tools like agent_write_file or agent_execute_command.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly mention when to use this tool versus alternatives. Usage is implied by the name and description (reading text files), but there is no guidance on exclusions or when to prefer a different sibling tool, such as agent_execute_command.

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/oemoem12/lmstudio-agent-mcp'

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