# read_workspace_file

读取工作区中某个文件的文本内容。 支持 UTF-8 编码的文本文件。二进制文件（图片、压缩包等）不支持。 大文件自动截断：最多读取前 512KB / 5000 行。 路径必须在已绑定的工作区范围内。

Agent View of the PolicyLayer registry record for `read_workspace_file`. HTML page: https://policylayer.com/tools/deepractice-promptx/read-workspace-file

## Facts

- Tool: `read_workspace_file`
- Server: PromptX (`deepractice/promptx`) — https://policylayer.com/tools/deepractice-promptx.md
- Homepage: https://github.com/Deepractice/PromptX
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "read_workspace_file",
    "arguments": {}
  }
}
```

## Why read_workspace_file is rated Low

This tool retrieves data (file text contents) without any side effects, modification, or destructive operations. It is a pure read operation scoped to workspace files. The low severity reflects that unauthorized file reads typically have limited immediate blast radius compared to write, execute, or destructive operations, though actual risk depends on file contents.

From the tool's own definition: "Tool name is 'read_workspace_file' and description states '读取工作区中某个文件的文本内容' (reads text content of a file in the workspace). The description explicitly mentions reading/retrieving file contents with no modification, deletion, or execution capabilities."

## Use case

AI agents call read_workspace_file to retrieve information from PromptX without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches PromptX:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "read_workspace_file": {}
  }
}
```

## Other tools on PromptX (13)

- `delete_workspace_item` — Destructive — https://policylayer.com/tools/deepractice-promptx/delete-workspace-item.md
- `toolx` — Execute — https://policylayer.com/tools/deepractice-promptx/toolx.md
- `learn` — Read — https://policylayer.com/tools/deepractice-promptx/learn.md
- `list_workspace_directory` — Read — https://policylayer.com/tools/deepractice-promptx/list-workspace-directory.md
- `list_workspaces` — Read — https://policylayer.com/tools/deepractice-promptx/list-workspaces.md
- `list_xlsx_sheets` — Read — https://policylayer.com/tools/deepractice-promptx/list-xlsx-sheets.md
- `read_docx` — Read — https://policylayer.com/tools/deepractice-promptx/read-docx.md
- `read_pdf` — Read — https://policylayer.com/tools/deepractice-promptx/read-pdf.md
- `read_pptx` — Read — https://policylayer.com/tools/deepractice-promptx/read-pptx.md
- `read_xlsx` — Read — https://policylayer.com/tools/deepractice-promptx/read-xlsx.md
- `create_workspace_directory` — Write — https://policylayer.com/tools/deepractice-promptx/create-workspace-directory.md
- `project` — Write — https://policylayer.com/tools/deepractice-promptx/project.md
- `write_workspace_file` — Write — https://policylayer.com/tools/deepractice-promptx/write-workspace-file.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=deepractice-promptx · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/deepractice-promptx
