Skip to main content
Glama
sweetwisdom

MCP Project Query Server

by sweetwisdom

add_project

Add new projects to the MCP Project Query Server by providing name, description, start date, investment amount, and progress details.

Instructions

新增项目

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYes

Implementation Reference

  • Registration of the 'add_project' MCP tool, including input schema (zod) and handler that delegates to ProjectController.addProject
    server.tool(
        'add_project',
        '新增项目',
        {
            project: z.object({
                name: z.string().describe('项目名称'),
                description: z.string().describe('项目描述'),
                startDate: z.string().describe('开始日期'),
                investment: z.number().describe('投资金额'),
                progress: z.number().describe('当前进度'),
            }),
        },
        async ({ project }) => {
            return await projectController.addProject(project);
        }
    );
  • Input schema for add_project tool using zod
    {
        project: z.object({
            name: z.string().describe('项目名称'),
            description: z.string().describe('项目描述'),
            startDate: z.string().describe('开始日期'),
            investment: z.number().describe('投资金额'),
            progress: z.number().describe('当前进度'),
        }),
    },
  • Handler in ProjectController that calls service to add project and returns formatted success/error response
    async addProject(project: Project): Promise<{ content: Array<{ type: "text"; text: string }> }> {
      try {
        await this.projectService.addProject(project);
        return {
          content: [
            {
              type: 'text',
              text: `新增项目成功: ${JSON.stringify(project)}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `新增项目失败: ${error instanceof Error ? error.message : '未知错误'}`,
            },
          ],
        };
      }
    }
  • ProjectService.addProject: adds project via repository and saves changes
    async addProject(project: Project): Promise<void> {
      this.projectRepository.addProject(project);
      await this.projectRepository.saveProjects();
    }
  • Repository method that appends the project to the in-memory array
    addProject(project: any): void {
      this.projects.push(project);
    }
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but fails completely. '新增项目' (add project) implies a write/mutation operation, but there's no information about permissions required, whether the operation is idempotent, what happens on failure, or what the response looks like. For a tool that creates data with multiple required parameters, this lack of behavioral context is a critical gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with just two characters, this represents under-specification rather than effective brevity. The description doesn't provide enough information to be useful, making it inefficient rather than well-structured. A single phrase without any elaboration fails to communicate necessary information about the tool's purpose and usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 required parameters in a nested object, no output schema, no annotations), the description is completely inadequate. It doesn't explain what the tool returns, what happens when it executes, what errors might occur, or how to interpret the parameters. For a mutation tool with significant complexity and no supporting structured data, this description provides almost no useful context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning none of the 5 nested parameters (name, description, startDate, investment, progress) have descriptions in the schema. The tool description provides absolutely no information about these parameters - not what they represent, what formats are expected, or what constraints apply. For a tool with 5 required parameters, this is severely inadequate.

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

Purpose2/5

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

The description '新增项目' (add project) is a tautology that merely restates the tool name without providing any meaningful elaboration. It doesn't specify what kind of project is being added, what system it's being added to, or how it differs from sibling tools like get_project_all or get_project_info. While the verb 'add' is clear, the lack of context makes this minimally informative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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. There are multiple sibling tools for retrieving project information (get_project_all, get_project_info, get_project_count), but the description doesn't indicate whether this is for creating new projects versus updating existing ones, or what prerequisites might be needed. No context about appropriate use cases is provided.

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/sweetwisdom/mcp-demo'

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