Skip to main content
Glama

create_journal_entry

Create dated journal entries with optional titles and content for personal documentation and reflection using LunaTask's encrypted productivity system.

Instructions

Create a journal entry for a specific date. Provide the date in YYYY-MM-DD format along with optional name and content fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_onYes
nameYes
contentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core logic handler for creating a journal entry.
    async def create_journal_entry_tool(  # noqa: PLR0911, PLR0915, C901
        self,
        ctx: ServerContext,
        *,
        date_on: str,
        name: str | None = None,
        content: str | None = None,
    ) -> dict[str, Any]:
        """Create a LunaTask journal entry for the provided date.
    
        Args:
            ctx: FastMCP execution context used for structured logging.
            date_on: ISO-8601 (YYYY-MM-DD) date that the journal entry belongs to.
            name: Optional title for the journal entry.
            content: Optional Markdown body for the journal entry.
    
        Returns:
            dict[str, Any]: Structured result containing a success flag, optional
            `journal_entry_id`, and a human-readable message or error details.
        """
    
        await ctx.info("Creating journal entry")
    
        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 create_journal_entry: %s", date_on)
            return {
                "success": False,
                "error": "validation_error",
                "message": message,
            }
    
        entry_payload = JournalEntryCreate(
            date_on=parsed_date,
            name=name,
            content=content,
        )
    
        try:
            async with self.lunatask_client as client:
                journal_entry = await client.create_journal_entry(entry_payload)
        except LunaTaskValidationError as error:
            message = f"Journal entry validation failed: {error}"
            await ctx.error(message)
            logger.warning("Journal entry validation error: %s", error)
            return {
                "success": False,
                "error": "validation_error",
                "message": message,
            }
        except LunaTaskSubscriptionRequiredError as error:
            message = f"Subscription required: {error}"
            await ctx.error(message)
            logger.warning("Subscription required during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "subscription_required",
                "message": message,
            }
        except LunaTaskAuthenticationError as error:
            message = f"Authentication failed: {error}"
            await ctx.error(message)
            logger.warning("Authentication error during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "authentication_error",
                "message": message,
            }
        except LunaTaskRateLimitError as error:
            message = f"Rate limit exceeded: {error}"
            await ctx.error(message)
            logger.warning("Rate limit exceeded during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "rate_limit_error",
                "message": message,
            }
        except (LunaTaskServerError, LunaTaskServiceUnavailableError) as error:
            message = f"Server error: {error}"
            await ctx.error(message)
            logger.warning("Server error during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "server_error",
                "message": message,
            }
        except LunaTaskTimeoutError as error:
            message = f"Request timeout: {error}"
            await ctx.error(message)
            logger.warning("Timeout during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "timeout_error",
                "message": message,
            }
        except LunaTaskNetworkError as error:
            message = f"Network error: {error}"
            await ctx.error(message)
            logger.warning("Network error during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "network_error",
                "message": message,
            }
        except LunaTaskAPIError as error:
            message = f"API error: {error}"
            await ctx.error(message)
            logger.warning("API error during journal entry creation: %s", error)
            return {
                "success": False,
                "error": "api_error",
                "message": message,
            }
        except Exception as error:
            message = f"Unexpected error creating journal entry: {error}"
            await ctx.error(message)
            logger.exception("Unexpected error during journal entry creation")
            return {
                "success": False,
                "error": "unexpected_error",
                "message": message,
            }
    
        await ctx.info(f"Successfully created journal entry {journal_entry.id}")
        logger.info("Successfully created journal entry %s", journal_entry.id)
        return {
            "success": True,
            "journal_entry_id": journal_entry.id,
            "message": "Journal entry created successfully",
        }
  • Registration of the create_journal_entry MCP tool.
    async def _create_journal_entry(
        ctx: ServerContext,
        *,
        date_on: str,
        name: str | None = None,
        content: str | None = None,
    ) -> dict[str, Any]:
        return await self.create_journal_entry_tool(
            ctx,
            date_on=date_on,
            name=name,
            content=content,
        )
    
    self.mcp.tool(
        name="create_journal_entry",
        description=(
            "Create a journal entry for a specific date. Provide the date in YYYY-MM-DD format"
            " along with optional name and content fields."
        ),
    )(_create_journal_entry)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It states 'Create' implying a write operation but doesn't disclose behavioral traits such as permissions needed, whether it's idempotent, error handling, or what happens on duplicate dates. It mentions optional fields but doesn't clarify default behaviors or constraints beyond format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences: one stating the purpose and another detailing parameters. It's front-loaded with the main action. There's minimal waste, though it could be slightly more structured by separating usage notes from parameter details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters with 0% schema coverage and an output schema present, the description provides basic parameter semantics but lacks depth. It doesn't cover behavioral aspects like side effects or error conditions, and since an output schema exists, it needn't explain return values. However, for a creation tool with no annotations, more context on permissions or constraints would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by specifying the date format (YYYY-MM-DD) and identifying name and content as optional fields, which clarifies beyond the schema's basic types. However, it doesn't explain parameter constraints, validation rules, or semantic roles, leaving gaps in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create') and resource ('journal entry'), specifying it's for a specific date. It distinguishes from siblings like create_note or create_task by focusing on journal entries with date specificity. However, it doesn't explicitly differentiate from create_person_timeline_note, which might also involve date-related entries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like create_note or create_person_timeline_note. It mentions the date format but offers no context about prerequisites, typical use cases, or exclusions. This leaves the agent guessing about appropriate scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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