Skip to main content
Glama

create_person

Add contacts to LunaTask with names, relationship strength, contact details, and duplicate detection to organize personal and professional connections.

Instructions

Create a person/contact in LunaTask. Requires first_name and last_name. Optional relationship_strength (family, intimate-friends, close-friends, casual-friends, acquaintances, business-contacts, almost-strangers), source/source_id for duplicate detection, email, birthday (YYYY-MM-DD), and phone. Returns person_id or duplicate status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
first_nameYes
last_nameYes
relationship_strengthNo
sourceNo
source_idNo
emailNo
birthdayNo
phoneNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler `create_person_tool` which validates input and calls the API client to create a person.
    async def create_person_tool(  # noqa: PLR0913
        self,
        ctx: ServerContext,
        first_name: str,
        last_name: str,
        relationship_strength: str | None = None,
        source: str | None = None,
        source_id: str | None = None,
        email: str | None = None,
        birthday: str | None = None,
        phone: str | None = None,
    ) -> dict[str, Any]:
        """Create a person in LunaTask with optional duplicate detection.
    
        Args:
            ctx: Server context for logging and communication
            first_name: Person's first name
            last_name: Person's last name
            relationship_strength: Optional relationship strength enum value
            source: Optional source identifier for duplicate detection
            source_id: Optional source-specific ID for duplicate detection
            email: Optional email address
            birthday: Optional birthday in YYYY-MM-DD format
            phone: Optional phone number
    
        Returns:
            Dictionary with success status, person_id (if created), and message.
            May include 'duplicate' flag if person already exists.
        """
    
        await ctx.info("Creating new person")
    
        # Validate and convert relationship_strength
        parsed_relationship_strength = PersonRelationshipStrength.CASUAL_FRIENDS
        if relationship_strength is not None:
            try:
                parsed_relationship_strength = PersonRelationshipStrength(relationship_strength)
            except ValueError:
                valid_values = ", ".join([e.value for e in PersonRelationshipStrength])
                message = (
                    f"Invalid relationship_strength '{relationship_strength}'. "
                    f"Must be one of: {valid_values}"
                )
                await ctx.error(message)
                logger.warning("Invalid relationship_strength provided: %s", relationship_strength)
                return {
                    "success": False,
                    "error": "validation_error",
                    "message": message,
                }
    
        # Parse birthday if provided
        parsed_birthday: date_class | None = None
        if birthday is not None:
            try:
                parsed_birthday = date_class.fromisoformat(birthday)
            except ValueError as error:
                message = f"Invalid birthday format. Expected YYYY-MM-DD format: {error!s}"
                await ctx.error(message)
                logger.warning("Invalid birthday provided for create_person: %s", birthday)
                return {
                    "success": False,
                    "error": "validation_error",
                    "message": message,
                }
    
        person_payload = PersonCreate(
            first_name=first_name,
            last_name=last_name,
            relationship_strength=parsed_relationship_strength,
            source=source,
            source_id=source_id,
            email=email,
            birthday=parsed_birthday,
            phone=phone,
        )
    
        try:
            async with self.lunatask_client as client:
                person_response = await client.create_person(person_payload)
    
        except Exception as error:
            return await self._handle_lunatask_api_errors(ctx, error, "person creation")
    
        if person_response is None:
            duplicate_message = "Person already exists for this source/source_id"
            await ctx.info("Person already exists; duplicate create skipped")
            logger.info("Duplicate person detected for source=%s, source_id=%s", source, source_id)
            return {
                "success": True,
                "duplicate": True,
                "message": duplicate_message,
            }
    
        await ctx.info(f"Successfully created person {person_response.id}")
        logger.info("Successfully created person %s", person_response.id)
        return {
            "success": True,
            "person_id": person_response.id,
            "message": "Person created successfully",
        }
  • Tool registration using `self.mcp.tool` in `_register_tools` for `create_person`.
    async def _create_person(  # noqa: PLR0913
        ctx: ServerContext,
        first_name: str,
        last_name: str,
        relationship_strength: str | None = None,
        source: str | None = None,
        source_id: str | None = None,
        email: str | None = None,
        birthday: str | None = None,
        phone: str | None = None,
    ) -> dict[str, Any]:
        return await self.create_person_tool(
            ctx,
            first_name,
            last_name,
            relationship_strength,
            source,
            source_id,
            email,
            birthday,
            phone,
        )
    
    valid_strengths = ", ".join([e.value for e in PersonRelationshipStrength])
    self.mcp.tool(
        name="create_person",
        description=(
            f"Create a person/contact in LunaTask. Requires first_name and last_name. "
            f"Optional relationship_strength ({valid_strengths}), "
            f"source/source_id for duplicate detection, email, birthday (YYYY-MM-DD), "
            f"and phone. Returns person_id or duplicate status."
        ),
    )(_create_person)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'duplicate detection' via source/source_id and describes the return values ('person_id or duplicate status'), which adds useful context beyond basic creation. However, it doesn't cover error conditions, permissions, or side effects, leaving gaps for a mutation tool.

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 and front-loaded, starting with the core action and required parameters, then listing optional ones efficiently. Every sentence adds value, though it could be slightly more structured (e.g., separating required vs. optional parameters more clearly).

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

Completeness4/5

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

Given the tool's complexity (8 parameters, mutation operation) and the presence of an output schema (which likely covers return values), the description is fairly complete. It explains key parameters and return behavior, though it lacks error handling or permission details. With no annotations, it does a good job but isn't fully comprehensive.

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

Parameters4/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the purpose of parameters like relationship_strength (with enum values), source/source_id for duplicate detection, and formats for birthday (YYYY-MM-DD). This compensates well for the schema's lack of descriptions, though it doesn't cover all 8 parameters in detail.

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

Purpose5/5

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

The description clearly states the specific action ('Create a person/contact in LunaTask') and identifies the resource ('person/contact'), distinguishing it from sibling tools like create_journal_entry or create_task. It goes beyond a tautology by specifying the domain (LunaTask) and the type of entity being created.

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_task, nor does it mention prerequisites beyond required parameters. It lacks explicit context about when this tool is appropriate compared to other person-related operations (e.g., update or delete).

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