Skip to main content
Glama
aaronfeingold

MCP Project Context Server

Start Session

start_session

Begin a development session by specifying project ID and goals to maintain context between coding sessions.

Instructions

Start a new development session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
goalsYesSession goals

Implementation Reference

  • The handler function that implements the core logic of the 'start_session' tool. It creates a new session using ProjectStore.createSession and returns a structured response with the session ID or error.
    async ({ projectId, goals }) => {
      try {
        const session = await this.store.createSession({
          projectId,
          startTime: new Date().toISOString(),
          goals,
          achievements: [],
          blockers: [],
          nextSession: [],
        });
        return {
          content: [
            {
              type: "text",
              text: `Session started with ID: ${session.sessionId}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error starting session: ${
                error instanceof Error ? error.message : "Unknown error"
              }`,
            },
          ],
        };
      }
    }
  • Input schema definition for the 'start_session' tool using Zod, specifying projectId and goals.
    inputSchema: {
      projectId: z.string().describe("Project ID"),
      goals: z.array(z.string()).describe("Session goals"),
    },
  • src/server.ts:364-405 (registration)
    Registration of the 'start_session' tool with the McpServer instance in the setupTools method.
    this.server.registerTool(
      "start_session",
      {
        title: "Start Session",
        description: "Start a new development session",
        inputSchema: {
          projectId: z.string().describe("Project ID"),
          goals: z.array(z.string()).describe("Session goals"),
        },
      },
      async ({ projectId, goals }) => {
        try {
          const session = await this.store.createSession({
            projectId,
            startTime: new Date().toISOString(),
            goals,
            achievements: [],
            blockers: [],
            nextSession: [],
          });
          return {
            content: [
              {
                type: "text",
                text: `Session started with ID: ${session.sessionId}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error starting session: ${
                  error instanceof Error ? error.message : "Unknown error"
                }`,
              },
            ],
          };
        }
      }
    );
  • Helper method in ProjectStore that persists the new session to a JSON file after validation and generates a unique sessionId.
    async createSession(
      sessionData: Omit<SessionContext, "sessionId">
    ): Promise<SessionContext> {
      const session: SessionContext = {
        ...sessionData,
        sessionId: uuidv4(),
      };
    
      const validated = SessionContextSchema.parse(session);
      const filePath = path.join(this.sessionsDir, `${session.sessionId}.json`);
      await fs.writeJson(filePath, validated, { spaces: 2 });
    
      return validated;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the action without disclosing behavioral traits. It doesn't mention if this creates persistent resources, requires authentication, has side effects, or what happens upon success/failure, which is inadequate for a tool that likely initiates a stateful process.

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 with zero wasted words. It's front-loaded and appropriately sized for the tool's apparent complexity, making it easy to parse 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 no annotations, no output schema, and a tool that likely creates a stateful session, the description is incomplete. It doesn't explain what a session is, what it enables, or what the agent should expect after invocation, leaving significant gaps for effective tool 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 both parameters (projectId and goals). The description adds no meaning beyond this, such as explaining how goals influence the session or what projectId references. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Start a new development session' clearly states the action (start) and resource (session), but it's vague about what a 'development session' entails and doesn't distinguish from sibling tools like 'end_session' or 'create_project'. It's functional but lacks specificity.

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?

No guidance is provided on when to use this tool versus alternatives like 'create_project' or 'end_session'. The description implies initiation but doesn't specify prerequisites, timing, or exclusions, leaving the agent to infer usage context.

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/aaronfeingold/mcp-project-context'

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