Skip to main content
Glama
davidteren

Claude Server MCP

by davidteren

save_project_context

Store project-specific information with relationships to maintain context across sessions in Claude Server MCP.

Instructions

Save project-specific context with relationships

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier for the context
projectIdYesProject identifier
contentYesContext content to save
parentContextIdNoOptional ID of parent context
referencesNoOptional related context IDs
tagsNoOptional tags for categorizing
metadataNoOptional additional metadata

Implementation Reference

  • Handler for the 'save_project_context' tool. Extracts input arguments, constructs a ProjectContext object, saves it using the saveContext method, and returns a confirmation message.
    case 'save_project_context': {
      const {
        id,
        projectId,
        content,
        parentContextId,
        references,
        tags,
        metadata,
      } = request.params.arguments as {
        id: string;
        projectId: string;
        content: string;
        parentContextId?: string;
        references?: string[];
        tags?: string[];
        metadata?: Record<string, unknown>;
      };
    
      const context: ProjectContext = {
        id,
        projectId,
        content,
        timestamp: new Date().toISOString(),
        parentContextId,
        references,
        tags,
        metadata,
      };
    
      await this.saveContext(context);
      return {
        content: [
          {
            type: 'text',
            text: `Project context saved with ID: ${id}`,
          },
        ],
      };
    }
  • src/index.ts:175-214 (registration)
    Tool registration in the ListTools response, including name, description, and full input schema for 'save_project_context'.
    {
      name: 'save_project_context',
      description: 'Save project-specific context with relationships',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Unique identifier for the context',
          },
          projectId: {
            type: 'string',
            description: 'Project identifier',
          },
          content: {
            type: 'string',
            description: 'Context content to save',
          },
          parentContextId: {
            type: 'string',
            description: 'Optional ID of parent context',
          },
          references: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional related context IDs',
          },
          tags: {
            type: 'array',
            items: { type: 'string' },
            description: 'Optional tags for categorizing',
          },
          metadata: {
            type: 'object',
            description: 'Optional additional metadata',
          },
        },
        required: ['id', 'projectId', 'content'],
      },
    },
  • TypeScript interface definition for ProjectContext, used in the tool's handler for type safety.
    interface ProjectContext extends BaseContext {
      projectId: string;
      parentContextId?: string;
      references?: string[];
    }
  • Core helper method that handles persisting the context to a JSON file and updating the central index. Invoked by the tool handler.
    private async saveContext(context: Context) {
      await this.ensureDirectories();
      const contextPath = await this.getContextPath(
        context.id,
        'projectId' in context ? context.projectId : undefined
      );
      
      await fs.writeFile(contextPath, JSON.stringify(context, null, 2), 'utf-8');
      await this.updateIndex(context);
    }
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 saves context with relationships, implying a write operation, but doesn't disclose critical behaviors like whether it overwrites existing context with the same ID, what permissions are required, error conditions, or response format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 that front-loads the core purpose ('save project-specific context with relationships') with zero waste. Every word earns its place, making it appropriately sized for the tool's complexity.

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 (7 parameters, mutation operation, no output schema, and no annotations), the description is incomplete. It doesn't explain the return values, error handling, or behavioral nuances like how 'relationships' are enforced or what happens on duplicate IDs. For a save operation with rich parameters, more context is needed.

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 7 parameters thoroughly. The description adds no additional meaning beyond implying relationships via 'parentContextId' and 'references', which is already clear from the schema. With high schema coverage, the baseline is 3, and the description doesn't compensate with extra insights.

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 action ('save') and resource ('project-specific context with relationships'), which is specific and actionable. It distinguishes from sibling 'save_conversation_context' by specifying 'project-specific' context, though it doesn't explicitly differentiate from 'get_context' or 'list_contexts' beyond the save vs. get/list distinction.

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 like 'save_conversation_context' for conversation contexts or when to retrieve vs. save using 'get_context'/'list_contexts'. It lacks explicit when/when-not instructions or prerequisites, leaving usage context implied by the tool name alone.

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/davidteren/claude-server'

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