Skip to main content
Glama
jankowtf

MCP Server Template for Cursor IDE

by jankowtf

apply_prompt_initial

Generate a structured prompt template to start new projects in Cursor IDE by defining objectives and optional instructions.

Instructions

Provides an initial prompt template for starting a new project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectiveYesA description of the objective of the project
specific_instructionsNoOptional specific instructions to include in the prompt
versionNoThe version of the prompt template to use (e.g., '1.0.0', '1.1.0', or 'latest')

Implementation Reference

  • The core handler function that executes the tool logic by rendering the 'init' prompt template and returning it as TextContent.
    async def apply_prompt_initial(
        objective: str,
        specific_instructions: str = "",
        version: str = "latest",
    ) -> list[types.TextContent]:
        """
        Provides an initial prompt template for starting a new coding objective.
    
        Args:
            objective: A description of the overall objective.
            specific_instructions: Optional specific instructions to include in the prompt.
            version: The version of the prompt template to use. Defaults to "latest".
    
        Returns:
            A list containing a TextContent object with the prompt.
        """
        # Render the prompt template with the objective and specific instructions
        response_text = render_prompt_template(
            "init",
            version_str=version,
            objective=objective,
            specific_instructions=specific_instructions,
        )
        return [types.TextContent(type="text", text=response_text)]
  • The input schema definition for the apply_prompt_initial tool registered in list_tools().
    types.Tool(
        name="apply_prompt_initial",
        description="Provides an initial prompt template for starting a new project",
        inputSchema={
            "type": "object",
            "required": ["objective"],
            "properties": {
                "objective": {
                    "type": "string",
                    "description": "A description of the objective of the project",
                },
                "specific_instructions": {
                    "type": "string",
                    "description": "Optional specific instructions to include in the prompt",
                },
                "version": {
                    "type": "string",
                    "description": "The version of the prompt template to use (e.g., '1.0.0', '1.1.0', or 'latest')",
                },
            },
        },
    ),
  • The registration and dispatch logic in the call_tool handler that invokes apply_prompt_initial upon matching the tool name.
    elif name == "apply_prompt_initial":
        if "objective" not in arguments:
            return [
                types.TextContent(
                    type="text", text="Error: Missing required argument 'objective'"
                )
            ]
        version = arguments.get("version", "latest")
        specific_instructions = arguments.get("specific_instructions", "")
        return await apply_prompt_initial(
            objective=arguments["objective"],
            specific_instructions=specific_instructions,
            version=version,
        )
  • Supporting utility function called by the handler to dynamically load and render the versioned 'init' prompt template using Jinja2.
    def render_prompt_template(
        template_name: str, version_str: str = "latest", **kwargs: Any
    ) -> str:
        """
        Render a prompt template with the given variables.
    
        Args:
            template_name: The name of the prompt template.
            version_str: The version of the template to use. Defaults to "latest".
            **kwargs: The variables to pass to the template.
    
        Returns:
            str: The rendered prompt template.
    
        Raises:
            FileNotFoundError: If the template file does not exist.
            jinja2.exceptions.TemplateError: If there is an error rendering the template.
            ValueError: If the specified version does not exist.
        """
        _build_version_registry()
    
        # Check if the template exists
        if template_name not in _version_registry:
            raise FileNotFoundError(f"Template not found: {template_name}")
    
        # Resolve the version
        if version_str == "latest":
            version_str = _version_registry[template_name].get("latest")
            if not version_str:
                raise ValueError(f"No versions found for template: {template_name}")
        elif version_str not in _version_registry[template_name]:
            # Try to find the closest version
            available_versions = get_template_versions(template_name)
            if not available_versions:
                raise ValueError(f"No versions found for template: {template_name}")
    
            # Find the highest version that is less than or equal to the requested version
            requested_ver = version.parse(version_str)
            for v in available_versions:
                if version.parse(v) <= requested_ver:
                    version_str = v
                    break
            else:
                # If no suitable version is found, use the oldest version
                version_str = available_versions[-1]
    
        # Get the filename from the registry
        filename = _version_registry[template_name][version_str]
    
        # Build the template path
        template_path = f"prompts/{template_name}/{filename}"
    
        # Load the template content
        content = load_template(template_path)
    
        # Parse the metadata and template content
        metadata, template_content = _parse_template_metadata(content)
    
        # Create a new template with just the content (without the front matter)
        env = get_template_env()
        template = env.from_string(template_content)
    
        # Render the template
        return template.render(**kwargs)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'provides' a template, implying a read-only or informational operation, but doesn't clarify if this involves fetching, generating, or applying the template, nor does it mention any side effects, permissions, or response format. For a tool with no annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'Provides an initial prompt template for starting a new project.' It is front-loaded with the core purpose, has zero wasted words, and is appropriately sized for the tool's apparent complexity. Every part of the sentence contributes directly to understanding the tool's function.

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

Completeness2/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is incomplete. It lacks behavioral context (e.g., what 'provides' entails), usage guidelines compared to siblings, and details on the output (since there's no output schema). For a tool in a family of prompt-related tools, more contextual information is needed to guide effective use.

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?

The input schema has 100% description coverage, with clear documentation for all three parameters (objective, specific_instructions, version). The description doesn't add any semantic details beyond what the schema provides, such as examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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's purpose: 'Provides an initial prompt template for starting a new project.' It specifies the verb ('provides'), resource ('initial prompt template'), and context ('for starting a new project'). However, it doesn't explicitly differentiate from sibling tools like 'apply_prompt_change' or 'apply_prompt_proceed', which likely serve different phases or aspects of prompt application.

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. It mentions 'starting a new project' but doesn't specify prerequisites, exclusions, or compare it to sibling tools such as 'apply_prompt_change' (for modifications) or 'apply_prompt_proceed' (for continuation). This lack of context leaves the agent to infer usage 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/jankowtf/mcp-hitchcode'

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