Skip to main content
Glama
jankowtf

MCP Server Template for Cursor IDE

by jankowtf

apply_prompt_docker

Generate Docker container configuration templates for containerization objectives using prompt-based templates in Cursor IDE.

Instructions

Provides a prompt template for Docker container configurations and orchestration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
containerization_objectiveYesDescription of the containerization objective
specific_instructionsNoOptional specific instructions about containerization requirements
versionNoThe version of the prompt template to use (e.g., '1.0.0', '1.1.0', or 'latest')

Implementation Reference

  • The core handler function for the 'apply_prompt_docker' tool. It renders and returns a Docker-specific prompt template based on the containerization objective, specific instructions, and version.
    async def apply_prompt_docker(
        containerization_objective: str,
        specific_instructions: str = "",
        version: str = "latest",
    ) -> list[types.TextContent]:
        """
        Provides a prompt template for Docker container configurations and orchestration.
    
        Args:
            containerization_objective: Description of the containerization objective.
            specific_instructions: Optional specific instructions about containerization requirements.
            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 containerization objective and specific instructions
        response_text = render_prompt_template(
            "docker",
            version_str=version,
            objective=containerization_objective,
            specific_instructions=specific_instructions,
        )
        return [types.TextContent(type="text", text=response_text)]
  • The tool registration in the list_tools() function, which defines the tool's name, description, and input schema for validation.
    types.Tool(
        name="apply_prompt_docker",
        description="Provides a prompt template for Docker container configurations and orchestration",
        inputSchema={
            "type": "object",
            "required": ["containerization_objective"],
            "properties": {
                "containerization_objective": {
                    "type": "string",
                    "description": "Description of the containerization objective",
                },
                "specific_instructions": {
                    "type": "string",
                    "description": "Optional specific instructions about containerization requirements",
                },
                "version": {
                    "type": "string",
                    "description": "The version of the prompt template to use (e.g., '1.0.0', '1.1.0', or 'latest')",
                },
            },
        },
    ),
  • Dispatch and input validation logic within the main @app.call_tool() handler that invokes the apply_prompt_docker function.
    elif name == "apply_prompt_docker":
        if "containerization_objective" not in arguments:
            return [
                types.TextContent(
                    type="text",
                    text="Error: Missing required argument 'containerization_objective'",
                )
            ]
        version = arguments.get("version", "latest")
        specific_instructions = arguments.get("specific_instructions", "")
        return await apply_prompt_docker(
            containerization_objective=arguments["containerization_objective"],
            specific_instructions=specific_instructions,
            version=version,
        )

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