delete_person
Remove a contact from LunaTask by specifying their person_id. This action permanently deletes the contact record and returns confirmation with deletion timestamp.
Instructions
Delete a person/contact in LunaTask by person_id. Requires person_id. Returns success status with person_id and deleted_at timestamp. Note: deletion is not idempotent - second delete will return not found error.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| person_id | Yes |
Implementation Reference
- src/lunatask_mcp/tools/people.py:359-406 (handler)The tool handler that performs the delete_person operation by interacting with the Lunatask client.
async def delete_person_tool( self, ctx: ServerContext, person_id: str, ) -> dict[str, Any]: """Delete a person in LunaTask. Args: ctx: Server context for logging and communication person_id: ID of the person to delete Returns: Dictionary with success status, person_id, deleted_at timestamp, and message. """ # Strip whitespace once at the beginning person_id = person_id.strip() await ctx.info(f"Deleting person {person_id}") # Validate person ID before making API call if not person_id: message = "Person ID cannot be empty" await ctx.error(message) logger.warning("Empty person ID provided for person deletion") return { "success": False, "error": "validation_error", "message": message, } try: async with self.lunatask_client as client: person_response = await client.delete_person(person_id) except Exception as error: return await self._handle_lunatask_api_errors(ctx, error, "person deletion") await ctx.info(f"Successfully deleted person {person_response.id}") logger.info("Successfully deleted person %s", person_response.id) return { "success": True, "person_id": person_response.id, "deleted_at": person_response.deleted_at.isoformat() if person_response.deleted_at else None, "message": "Person deleted successfully", } - src/lunatask_mcp/tools/people.py:465-478 (registration)The registration of the 'delete_person' tool with the MCP server.
async def _delete_person( ctx: ServerContext, person_id: str, ) -> dict[str, Any]: return await self.delete_person_tool(ctx, person_id) self.mcp.tool( name="delete_person", description=( "Delete a person/contact in LunaTask by person_id. Requires person_id. " "Returns success status with person_id and deleted_at timestamp. " "Note: deletion is not idempotent - second delete will return not found error." ), )(_delete_person)