Skip to main content
Glama

Zen Continuation

ultra-continuation

Continue conversations with previous session context to maintain continuity across interactions, enabling context revival for AI providers like OpenAI and Gemini.

Instructions

Continue a conversation with context from a previous session, enabling context revival across interactions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID to continue from
promptYesNew prompt or question to continue the conversation
providerNoAI provider to use (optional, defaults to best available)
modelNoSpecific model to use (optional)
includeFilesNoWhether to include file context from the session (default: true)

Implementation Reference

  • Main handler function that executes the ultra-continuation tool: retrieves session context, builds conversation history, generates AI continuation, saves new messages, and returns formatted response.
    export async function handleContinuation(args: any, providerManager: ProviderManager) {
      const { sessionId, prompt, provider, model, includeFiles = true } = args;
    
      // Get conversation context
      const context = await conversationMemory.getConversationContext(sessionId, 8000, includeFiles);
      
      if (context.messages.length === 0) {
        throw new Error(`No conversation found for session ${sessionId}`);
      }
    
      // Build conversation history for the model (excluding 'tool' role)
      const messages = context.messages
        .filter(msg => msg.role !== 'tool')
        .map(msg => ({
          role: msg.role as 'user' | 'assistant' | 'system',
          content: msg.content
        }));
    
      // Add file context if available
      let fileContext = '';
      if (context.files.length > 0) {
        fileContext = '\n\nRelevant files from conversation:\n' +
          context.files.map(f => `**${f.filePath}**:\n${f.fileContent}`).join('\n\n');
      }
    
      // Add the new prompt
      messages.push({
        role: 'user',
        content: prompt + fileContext
      });
    
      // Build a single prompt from the conversation history
      const conversationHistory = messages.map(msg => `${msg.role}: ${msg.content}`).join('\n\n');
      
      // Use provider manager to get response
      const aiProvider = await providerManager.getProvider(provider);
      const result = await aiProvider.generateText({
        prompt: conversationHistory,
        model: model || aiProvider.getDefaultModel(),
        temperature: 0.7,
        useSearchGrounding: false
      });
    
      // Save new messages to conversation
      await conversationMemory.addMessage(sessionId, 'user', prompt, 'continuation');
      await conversationMemory.addMessage(
        sessionId,
        'assistant', 
        result.text,
        'continuation',
        undefined,
        { provider, model: result.model, continuedFromSession: true }
      );
    
      return {
        content: [
          {
            type: 'text',
            text: `## Continued Conversation\n\nSession: ${sessionId}\nContext: ${context.messages.length} messages, ${context.files.length} files\n\n${result.text}`
          }
        ]
      };
    }
  • Zod schema defining the input parameters for the ultra-continuation tool.
    const ZenContinuationSchema = z.object({
      sessionId: z.string().describe("Session ID to continue from"),
      prompt: z.string().describe("New prompt or question to continue the conversation"),
      provider: z.enum(["openai", "gemini", "azure", "grok", "openai-compatible"]).optional().describe("AI provider to use (optional, defaults to best available)"),
      model: z.string().optional().describe("Specific model to use (optional)"),
      includeFiles: z.boolean().optional().describe("Whether to include file context from the session (default: true)"),
    });
  • src/server.ts:977-984 (registration)
    MCP server registration of the ultra-continuation tool, including metadata and handler reference.
    server.registerTool("ultra-continuation", {
      title: "Zen Continuation",
      description: "Continue a conversation with context from a previous session, enabling context revival across interactions",
      inputSchema: ZenContinuationSchema.shape,
    }, async (args) => {
      const provider = await getProviderManager();
      return await handleContinuation(args, provider) as any;
    });
  • MCP server registration of the prompt version for ultra-continuation.
    server.registerPrompt("ultra-continuation", {
      title: "Zen Continuation",
      description: "Continue conversations with session context revival",
      argsSchema: {
        sessionId: z.string(),
        prompt: z.string(),
        provider: z.string().optional(),
        model: z.string().optional(),
        includeFiles: z.string().optional(),
      },
    }, (args) => ({
      messages: [{
        role: "user",
        content: {
          type: "text",
          text: `Continue conversation from session ${args.sessionId}: ${args.prompt}${args.includeFiles === 'false' ? ' (without files)' : ''}${args.provider ? ` (using ${args.provider} provider)` : ''}`
        }
      }]
    }));
  • Import statement bringing in the handleContinuation function and other ultra tools from the handlers module.
    import { ultraTools, handleChallenge, handleContinuation, handleSession, handleBudget } from './handlers/ultra-tools.js';
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 mentions 'context revival across interactions,' which implies persistence, but doesn't detail how context is stored, retrieved, or managed (e.g., session lifetime, data privacy, or error handling). For a tool with 5 parameters and no annotations, this is a significant gap, as it lacks information on permissions, rate limits, or operational constraints.

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 appropriately sized and front-loaded: a single, clear sentence that states the core functionality without unnecessary details. Every word earns its place by defining the tool's purpose efficiently, making it easy for an agent to grasp the intent quickly.

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 complexity (5 parameters, session-based AI interactions) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like how context is handled, what the output looks like, or potential side effects. For a tool that likely involves AI model calls and session management, more context 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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what the schema provides (e.g., it doesn't explain how 'sessionId' is obtained or what 'context revival' entails in practice). With high schema coverage, the baseline is 3, and the description doesn't compensate further.

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: 'Continue a conversation with context from a previous session, enabling context revival across interactions.' It specifies the verb ('continue') and resource ('conversation'), and distinguishes it from siblings by focusing on session-based continuation rather than analysis, debugging, or other tasks. However, it doesn't explicitly differentiate from 'ultra-session' or other session-related tools, keeping it at a 4 instead of 5.

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 doesn't mention when to choose this over starting a new conversation, using other session tools like 'ultra-session', or applying other AI interaction tools. With no explicit usage context or exclusions, it scores a 2.

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/RealMikeChong/ultra-mcp'

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