Skip to main content
Glama
njlnaet
by njlnaet

coderswap_log_session_note

Record session summaries to maintain continuity across research projects by capturing key insights and progress markers for future reference.

Instructions

Record lightweight ingestion summary for session continuity (non-DSL)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYes
summary_textYes
job_idNo
ingestion_metricsNo
tagsNo

Implementation Reference

  • The asynchronous handler function that executes the core logic of the 'coderswap_log_session_note' tool. It checks for guardrail bypasses, generates a note ID, logs the session note details using the log utility, and returns structured output with success or error response.
    async ({ project_id, summary_text, job_id, ingestion_metrics, tags }) => {
      if (containsGuardrailBypass({ project_id, summary_text, job_id, ingestion_metrics, tags })) {
        return guardrailViolationResponse()
      }
      try {
        log('debug', 'Logging session note', { project_id, job_id })
    
        // Generate a simple note ID
        const timestamp = new Date().toISOString()
        const note_id = `note_${Date.now()}`
    
        // Log the note (for now, just to console/debug)
        log('info', `Session note logged for project ${project_id}`, {
          note_id,
          summary_text,
          job_id,
          ingestion_metrics,
          tags
        })
    
        const output = {
          note_id,
          project_id,
          timestamp
        }
    
        return {
          content: [{
            type: 'text',
            text: `✓ Logged session note: ${summary_text.substring(0, 100)}${summary_text.length > 100 ? '...' : ''}`
          }],
          structuredContent: output
        }
      } catch (error) {
        log('error', 'Failed to log session note', { project_id, error: error instanceof Error ? error.message : error })
        return {
          content: [{
            type: 'text',
            text: `✗ Failed to log session note: ${error instanceof Error ? error.message : 'Unknown error'}`
          }],
          isError: true
        }
      }
    }
  • The inputSchema and outputSchema definitions using Zod for validating the tool's inputs (project_id, summary_text, etc.) and outputs (note_id, etc.). Includes title and description.
    {
      title: 'Log Session Note',
      description: 'Record lightweight ingestion summary for session continuity (non-DSL)',
      inputSchema: {
        project_id: z.string().min(1, 'project_id is required'),
        summary_text: z.string().min(1, 'summary_text is required'),
        job_id: z.string().optional(),
        ingestion_metrics: z.any().optional(),
        tags: z.any().optional()
      },
      outputSchema: {
        note_id: z.string(),
        project_id: z.string(),
        timestamp: z.string()
      }
  • src/index.ts:634-696 (registration)
    The server.registerTool call that registers the 'coderswap_log_session_note' tool with the MCP server, providing the tool name, metadata/schemas, and handler function.
    server.registerTool(
      'coderswap_log_session_note',
      {
        title: 'Log Session Note',
        description: 'Record lightweight ingestion summary for session continuity (non-DSL)',
        inputSchema: {
          project_id: z.string().min(1, 'project_id is required'),
          summary_text: z.string().min(1, 'summary_text is required'),
          job_id: z.string().optional(),
          ingestion_metrics: z.any().optional(),
          tags: z.any().optional()
        },
        outputSchema: {
          note_id: z.string(),
          project_id: z.string(),
          timestamp: z.string()
        }
      },
      async ({ project_id, summary_text, job_id, ingestion_metrics, tags }) => {
        if (containsGuardrailBypass({ project_id, summary_text, job_id, ingestion_metrics, tags })) {
          return guardrailViolationResponse()
        }
        try {
          log('debug', 'Logging session note', { project_id, job_id })
    
          // Generate a simple note ID
          const timestamp = new Date().toISOString()
          const note_id = `note_${Date.now()}`
    
          // Log the note (for now, just to console/debug)
          log('info', `Session note logged for project ${project_id}`, {
            note_id,
            summary_text,
            job_id,
            ingestion_metrics,
            tags
          })
    
          const output = {
            note_id,
            project_id,
            timestamp
          }
    
          return {
            content: [{
              type: 'text',
              text: `✓ Logged session note: ${summary_text.substring(0, 100)}${summary_text.length > 100 ? '...' : ''}`
            }],
            structuredContent: output
          }
        } catch (error) {
          log('error', 'Failed to log session note', { project_id, error: error instanceof Error ? error.message : error })
          return {
            content: [{
              type: 'text',
              text: `✗ Failed to log session note: ${error instanceof Error ? error.message : 'Unknown error'}`
            }],
            isError: true
          }
        }
      }
    )

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/njlnaet/mcp-server'

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