Skip to main content
Glama
elizagarate

Things MCP Server

by elizagarate

get_headings

Retrieve headings from Things projects to view their sections. Optionally filter by project UUID.

Instructions

Get headings from Things

Args: project_uuid: Optional UUID of a specific project to get headings from

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_uuidNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the get_headings tool. Accepts an optional project_uuid, validates it if provided, fetches headings via the 'things' library, formats them using format_heading(), and returns as a string.
    @mcp.tool
    async def get_headings(project_uuid: str = None) -> str:
        """Get headings from Things
    
        Args:
            project_uuid: Optional UUID of a specific project to get headings from
        """
        if project_uuid:
            project = things.get(project_uuid)
            if not project or project.get('type') != 'project':
                return f"Error: Invalid project UUID '{project_uuid}'"
            headings = things.tasks(type='heading', project=project_uuid)
        else:
            headings = things.tasks(type='heading')
    
        if not headings:
            return "No headings found"
    
        formatted_headings = [format_heading(heading) for heading in headings]
        return "\n\n---\n\n".join(formatted_headings)
  • The @mcp.tool decorator registers get_headings as a tool on the FastMCP server instance.
    @mcp.tool
  • Helper function that formats a single heading dictionary into a human-readable string. Includes title, UUID, type, project info, dates with age calculation, notes, and optionally tasks under the heading.
    def format_heading(heading: dict, include_items: bool = False) -> str:
        """Helper function to format a single heading."""
        heading_text = f"Title: {heading['title']}\nUUID: {heading['uuid']}"
        heading_text += f"\nType: heading"
    
        # Add project info if present
        if heading.get('project'):
            if heading.get('project_title'):
                heading_text += f"\nProject: {heading['project_title']}"
            else:
                try:
                    project = things.get(heading['project'])
                    if project:
                        heading_text += f"\nProject: {project['title']}"
                except Exception:
                    pass
    
        # Add dates
        if heading.get('created'):
            heading_text += f"\nCreated: {heading['created']}"
            try:
                age_text = _calculate_age(heading['created'])
                heading_text += f"\nAge: {age_text}"
            except (ValueError, TypeError):
                pass
        if heading.get('modified'):
            heading_text += f"\nModified: {heading['modified']}"
            try:
                modified_age = _calculate_age(heading['modified'])
                heading_text += f"\nLast modified: {modified_age}"
            except (ValueError, TypeError):
                pass
    
        # Add notes if present
        if heading.get('notes'):
            heading_text += f"\nNotes: {heading['notes']}"
    
        if include_items:
            # Get todos under this heading
            todos = things.todos(heading=heading['uuid'])
            if todos:
                heading_text += "\n\nTasks under heading:"
                for todo in todos:
                    heading_text += f"\n- {todo['title']}"
    
        return heading_text
  • The get_headings handler imports format_heading from .formatters (line 6 of server.py: 'from .formatters import ... format_heading').
    formatted_headings = [format_heading(heading) for heading in headings]
    return "\n\n---\n\n".join(formatted_headings)
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It only states it 'gets' headings, implying a read operation, but provides no details on return format, pagination, or any side effects. The output schema exists but is not referenced.

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 very concise with two sentences, but it could benefit from a brief note on what headings are or the output structure. The lack of structure is minor given the tool's simplicity.

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?

The tool appears simple, but the description does not reference the output schema or explain the concept of headings. For a retrieval tool with a single optional parameter, the description is minimally adequate but could be more informative.

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 meaning to the sole parameter 'project_uuid' by specifying it is optional and a UUID for filtering, which exceeds the schema's minimal definition. However, it does not explain the default behavior when omitted.

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 tool retrieves headings from Things, using the verb 'Get' and specifying the resource 'headings'. This distinguishes it from sibling tools like get_projects or get_todos, though it doesn't elaborate on what headings are.

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?

No guidance is provided on when to use this tool versus alternatives. The description only mentions an optional parameter, but does not explain conditions for use or exclude scenarios, leaving the agent to infer usage.

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/elizagarate/things-mcp'

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