Set destructive false on read-only MCP tools

Omiting destructiveHint defaults to true in the MCP spec, so reads
must set it explicitly even though the field is only meaningful when
not read-only.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-30 08:56:36 +00:00
parent a13dbe1e78
commit 7a83f2bc65
2 changed files with 113 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ tools:
description: List all thirdParties for the organization
hints:
readonly: true
destructive: false
idempotent: true
openWorld: false
inputSchema:
@@ -70,10 +71,13 @@ defaults are surprising (`destructiveHint` defaults to **true**,
| Hint | Reads | Additive writes | Deletes / regenerates |
|---|---|---|---|
| `readonly` | `true` | `false` | `false` |
| `destructive` | omit | `false` | `true` |
| `idempotent` | `true` | `false` for creates, `true` for updates | `true` |
| `destructive` | `false` | `false` | `true` |
| `idempotent` | `true` | `false` for creates, `true` for updates | `true` (regenerates: `false`) |
| `openWorld` | `false` | `false` (unless the tool calls out, e.g. `vetThirdParty`) | `false` |
Always set all four hints. Do not omit `destructive` or `openWorld`
both default to **true** in the MCP spec when absent.
Input/output schemas reference `components/schemas`. Map custom Go types with the `go.probo.inc/mcpgen/type` extension:
```yaml