delete_object
Permanently removes an object and all its content from an Anytype space. Verify object ID before deletion as this action is irreversible.
Instructions
Permanently removes an object from a specified Anytype space. This tool deletes the object and all its content. Use this tool with caution as deleted objects cannot be recovered. Always verify the object ID before deletion to avoid removing important content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | Space ID containing the object | |
| object_id | Yes | Object ID to delete |
Implementation Reference
- src/index.ts:285-302 (handler)The asynchronous handler function that executes the DELETE API request to permanently remove the specified object from the Anytype space.async ({ space_id, object_id }) => { try { const response = await this.makeRequest( "delete", `/spaces/${space_id}/objects/${object_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } }
- src/index.ts:281-284 (schema)Zod input schema defining the required parameters: space_id and object_id.{ space_id: z.string().describe("Space ID containing the object"), object_id: z.string().describe("Object ID to delete"), },
- src/index.ts:278-303 (registration)The registration of the 'delete_object' tool using this.server.tool(), including name, description, schema, and inline handler.this.server.tool( "delete_object", "Permanently removes an object from a specified Anytype space. This tool deletes the object and all its content. Use this tool with caution as deleted objects cannot be recovered. Always verify the object ID before deletion to avoid removing important content.", { space_id: z.string().describe("Space ID containing the object"), object_id: z.string().describe("Object ID to delete"), }, async ({ space_id, object_id }) => { try { const response = await this.makeRequest( "delete", `/spaces/${space_id}/objects/${object_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return this.handleApiError(error); } } );