REST backend for Platypus - a multi-agent chat platform with plugin support, sandbox execution, and MCP integration
Platypus Backend provides 5 well-named sandbox tools with clear, comprehensive descriptions and complete input schemas. All tools follow verb_noun naming convention (shellExec, fsRead, fsWrite, fsEdit, fsList). Descriptions are concise (50-150 chars), explain WHEN to use each tool, and document limitations (output capping, truncation). All parameters have type definitions and descriptions. Risk annotations (IRREVERSIBLE, READ_ONLY, WRITE) are present and actionable. Output schemas are not explicitly documented in the source, which is a notable gap for production tooling. Parameters use appropriate constraints (enums for mode, lineRange with format hints). Error handling is mentioned in descriptions (truncated flag, not-found cases) but recovery guidance in error responses is not visible in the provided code.
Edit a file by replacing exactly one occurrence of `oldString` with `newString`. Fails if `oldString` is absent or appears more than once. Prefer this over rewriting whole files.
List files and directories in the sandbox. Pass `recursive: true` to descend, and `glob` (e.g. "**/*.ts") to filter. Output is capped; check the `truncated` flag.
Read a UTF-8 text file from the sandbox. Paths are relative to the workspace root. Pass `lineRange: [start, end]` (1-indexed, inclusive) to read a slice. Large files are truncated.
Write a UTF-8 text file in the sandbox. `mode: "create"` fails if the file already exists; `mode: "overwrite"` replaces it. Parent directories are created automatically.
Run a shell command in the sandbox. Each call starts a fresh shell — there is no persistent shell state between calls. Pass `cwd` (relative to the workspace root) to choose the working directory. Output is capped; check the `truncated` flag.
Output schemas not explicitly documented. The rubric requires documentation of return types so LLMs know what fields to expect for chaining. While risk classifications (IRREVERSIBLE, READ_ONLY, WRITE) are present and helpful, formal schemas for tool outputs (e.g., shellExec returns {stdout, stderr, exitCode, truncated}) are not visible in the source.
Error recovery guidance not visible. Descriptions mention output capping and truncation flags, but the source does not show how tools guide LLMs on error cases (e.g., 'If output is truncated, call with a more specific command'). Error responses should include actionable next steps.
Missing parameter constraint documentation for some fields. The 'env' parameter in shellExec is documented as 'Environment variables to pass' but lacks format guidance (JSON object structure, allowed keys, value types). Similarly, 'glob' in fsList should document glob syntax conventions.
Inferred effective spec: 2026-07-28+.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 67 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 23 | - | v1 |
No idempotency or dry-run support for irreversible operations. shellExec is marked IRREVERSIBLE but offers no --dry-run or confirmation step. Best practice for destructive tools is a confirmation request pattern to prevent accidental data loss.