# set_workspace

Set the active workspace directory

Agent View of the PolicyLayer registry record for `set_workspace`. HTML page: https://policylayer.com/tools/agentics-ai-code-mcp/set-workspace

## Facts

- Tool: `set_workspace`
- Server: Code MCP Server (`agentics-ai/code-mcp`) — https://policylayer.com/tools/agentics-ai-code-mcp.md
- Homepage: https://github.com/agentics-ai/code-mcp
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

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

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

## Why set_workspace is rated Medium

This tool changes configuration state (the active workspace) rather than permanently destroying data. While it affects the execution context of other tools, the change itself is reversible—another set_workspace call can restore the previous state. This makes it a Write operation.

From the tool's own definition: "Tool name is 'set_workspace' and description states 'Set the active workspace directory' — this modifies the state of the active workspace configuration, which is a reversible change affecting subsequent tool operations."

## Use case

AI agents use set_workspace to create or update resources in Code MCP Server, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Code MCP Server environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Code MCP Server:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "set_workspace": {
      "limits": [
        {
          "counter": "set_workspace_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Code MCP Server (72)

- `delete_file` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/delete-file.md
- `docker_cleanup` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-cleanup.md
- `docker_containers` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-containers.md
- `remove_allowed_command` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/remove-allowed-command.md
- `rollback_session` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/rollback-session.md
- `docker_build` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-build.md
- `docker_compose` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-compose.md
- `docker_images` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-images.md
- `docker_networks` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-networks.md
- `docker_run` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-run.md
- `docker_system` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-system.md
- `docker_volumes` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-volumes.md
- `git_push` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/git-push.md
- `install_dependencies` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/install-dependencies.md
- `npm_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/npm-command.md
- `pip_install` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/pip-install.md
- `run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-command.md
- `run_custom_tool` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-custom-tool.md
- `run_javascript` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-javascript.md
- `run_python` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-python.md
- `run_tests` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-tests.md
- `secure_run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command.md
- `secure_run_command_sequence` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command-sequence.md
- `start_coding_session` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-coding-session.md
- `start_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-server.md
- `stop_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/stop-server.md
- `end_coding_session` — Other — https://policylayer.com/tools/agentics-ai-code-mcp/end-coding-session.md
- `analyze_code` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-code.md
- `analyze_file_differences` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-file-differences.md
- `compare_commits` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/compare-commits.md
- …and 42 more: https://policylayer.com/tools/agentics-ai-code-mcp.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=agentics-ai-code-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/agentics-ai-code-mcp
