Skip to main content
Glama

design_context_architecture

Designs custom agent architectures and persistent workflows by generating component blueprints based on user goals and constraints.

Instructions

Architects a custom context system based on a high-level goal (The Architect).
Returns a blueprint of Sutra components (Molecules, Cells, Organs, Thinking Models).

Use this when the user wants to build a persistent agent or complex workflow
rather than solving a single immediate task.

Args:
    goal: The user's objective (e.g., "Build a writing assistant that learns my style").
    constraints: Optional limits (e.g., "Must be lightweight").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalYes
constraintsNo

Implementation Reference

  • The core handler function for the design_context_architecture tool. Decorated with @mcp.tool() for MCP registration. Validates inputs and generates a context architecture blueprint based on goal and constraints using heuristic matching.
    @mcp.tool()
    def design_context_architecture(goal: str, constraints: str | None = None) -> dict:
        """
        Architects a custom context system based on a high-level goal (The Architect).
        Returns a blueprint of Sutra components (Molecules, Cells, Organs, Thinking Models).
    
        Use this when the user wants to build a persistent agent or complex workflow
        rather than solving a single immediate task.
    
        Args:
            goal: The user's objective (e.g., "Build a writing assistant that learns my style").
            constraints: Optional limits (e.g., "Must be lightweight").
        """
        try:
            model = DesignArchitectureInput(goal=goal, constraints=constraints)
        except ValidationError as e:
            return {"error": str(e)}
    
        g = model.goal.lower()
        c = (model.constraints or "").lower()
    
        # Blueprint Defaults
        blueprint: dict[str, Any] = {
            "name": "Custom System",
            "rationale": "General purpose context structure.",
            "components": {
                "molecule": "Standard CoT",
                "cell": "cell.protocol.key_value",
                "organ": None,
                "cognitive": "reasoning.understand_question",
            },
        }
    
        if "lightweight" in c:
            blueprint["name"] += " (Light)"
    
        # Heuristic Architecture Logic
        if "debate" in g or "perspective" in g:
            blueprint["name"] = "Debate System"
            blueprint["components"]["organ"] = "organ.debate_council"
            blueprint["rationale"] = "Uses a multi-perspective organ to balance viewpoints."
    
        elif "research" in g or "report" in g or "synthesize" in g:
            blueprint["name"] = "Research Engine"
            blueprint["components"]["organ"] = "organ.research_synthesis"
            blueprint["components"]["cell"] = (
                "cell.protocol.episodic"  # Log research trails
            )
            blueprint["rationale"] = (
                "Combines a synthesis organ with episodic memory to track findings."
            )
    
        elif "learn" in g or "remember" in g or "style" in g:
            blueprint["name"] = "Adaptive Assistant"
            blueprint["components"]["cell"] = "cell.protocol.windowed"
            blueprint["rationale"] = (
                "Uses windowed memory to maintain recent context and style."
            )
    
        elif "code" in g or "bug" in g or "review" in g:
            blueprint["name"] = "Code Auditor"
            blueprint["components"]["cognitive"] = "reasoning.verify_logic"
            blueprint["rationale"] = "Focuses on logic verification for code correctness."
    
        return blueprint
  • Pydantic input schema (BaseModel) used for validating the parameters of the design_context_architecture tool.
    class DesignArchitectureInput(BaseModel):
        goal: str = Field(
            ..., min_length=5, description="The goal of the system to design."
        )
        constraints: str | None = Field(
            None, description="Optional constraints or preferences."
        )
  • The @mcp.tool() decorator registers the design_context_architecture function as an MCP tool.
    @mcp.tool()

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/4rgon4ut/sutra'

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