Skip to main content
Glama

create_person_timeline_note

Add timeline notes to a person's record in LunaTask, associating information with specific dates for tracking history and context.

Instructions

Create a timeline note for a person in LunaTask. Requires person_id and content. Optional date_on (YYYY-MM-DD) to associate the note with a specific day.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
person_idYes
contentYes
date_onNo

Implementation Reference

  • The handler function that executes the "create_person_timeline_note" tool logic.
    async def create_person_timeline_note_tool(
        self,
        ctx: ServerContext,
        person_id: str,
        content: str,
        date_on: str | None = None,
    ) -> dict[str, Any]:
        """Create a timeline note for a person in LunaTask.
    
        Args:
            ctx: Server context for logging and communication
            person_id: ID of the person to add the timeline note to
            content: Content of the timeline note
            date_on: Optional date in YYYY-MM-DD format to associate with the note
    
        Returns:
            Dictionary with success status, person_timeline_note_id, and message.
        """
    
        await ctx.info("Creating person timeline note")
    
        if not person_id.strip():
            message = "person_id is required to create a timeline note"
            await ctx.error(message)
            logger.warning("Missing person_id for person timeline note creation")
            return {
                "success": False,
                "error": "validation_error",
                "message": message,
            }
    
        if content.strip() == "":
            message = "content cannot be empty when creating a timeline note"
            await ctx.error(message)
            logger.warning("Empty content provided for person timeline note creation")
            return {
                "success": False,
                "error": "validation_error",
                "message": message,
            }
    
        parsed_date: date_class | None = None
        if date_on is not None:
            try:
                parsed_date = date_class.fromisoformat(date_on)
            except ValueError as error:
                message = f"Invalid date_on format. Expected YYYY-MM-DD format: {error!s}"
                await ctx.error(message)
                logger.warning("Invalid date_on provided for person timeline note: %s", date_on)
                return {
                    "success": False,
                    "error": "validation_error",
                    "message": message,
                }
    
        note_payload = PersonTimelineNoteCreate(
            person_id=person_id,
            content=content.strip(),
            date_on=parsed_date,
        )
    
        try:
            async with self.lunatask_client as client:
                note_response = await client.create_person_timeline_note(note_payload)
    
        except Exception as error:
            return await self._handle_lunatask_api_errors(ctx, error, "timeline note creation")
    
        await ctx.info(f"Person timeline note created: {note_response.id}")
        logger.info("Created person timeline note %s", note_response.id)
        return {
            "success": True,
            "person_timeline_note_id": note_response.id,
            "message": "Person timeline note created successfully",
        }
  • Tool registration for "create_person_timeline_note".
    async def _create_person_timeline_note(
        ctx: ServerContext,
        person_id: str,
        content: str,
        date_on: str | None = None,
    ) -> dict[str, Any]:
        return await self.create_person_timeline_note_tool(ctx, person_id, content, date_on)
    
    self.mcp.tool(
        name="create_person_timeline_note",
        description=(
            "Create a timeline note for a person in LunaTask. Requires person_id and content. "
            "Optional date_on (YYYY-MM-DD) to associate the note with a specific day."
        ),
    )(_create_person_timeline_note)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tensorfreitas/lunatask-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server