Skip to main content
Glama
sweetwisdom

MCP Project Query Server

by sweetwisdom

get_project_info

Retrieve project details including start date, description, investment amount, and current status by providing the project name.

Instructions

根据项目名称查询项目基本信息,包括开始日期、简介、投资金额和当前进度

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameYes要查询的项目名称

Implementation Reference

  • Core handler logic for the get_project_info tool: retrieves project data via service, formats it into MCP-compatible content blocks (JSON stringified), handles missing projects and errors gracefully.
    async getProjectInfo(projectName: string): Promise<{ content: Array<{ type: "text"; text: string }> }> {
      try {
        const project = await this.projectService.getProjectInfo(projectName);
    
        if (!project) {
          return {
            content: [
              {
                type: "text" as const,
                text: `未找到名为"${projectName}"的项目。`,
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(project),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: `查询项目时出错: ${error instanceof Error ? error.message : '未知错误'}`,
            },
          ],
        };
      }
    }
  • Registers the 'get_project_info' MCP tool with name, description, input schema (projectName: string), and delegates to ProjectController.getProjectInfo().
    server.tool(
        'get_project_info',
        '根据项目名称查询项目基本信息,包括开始日期、简介、投资金额和当前进度',
        {
            projectName: z.string().describe('要查询的项目名称'),
        },
        async ({ projectName }) => {
            return await projectController.getProjectInfo(projectName);
        }
    );
  • Input schema for the tool using Zod: requires 'projectName' as string.
    {
        projectName: z.string().describe('要查询的项目名称'),
    },
  • Helper service method that fetches the project by name from the repository, returning null if not found.
    async getProjectInfo(projectName: string): Promise<Project | null> {
      return this.projectRepository.findProjectByName(projectName) || null;
    }
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 this is a query operation ('查询'), implying it's likely read-only and non-destructive, but doesn't explicitly confirm safety aspects like permissions, rate limits, or error handling. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior beyond basic functionality.

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

Conciseness4/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 and lists returned fields. There's no wasted text, and it's appropriately sized for a simple query tool. However, it could be slightly more structured by separating purpose from returned data for better readability.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers what the tool does and what it returns, but lacks details on behavioral traits, usage context, and error handling. Without annotations or output schema, the agent has incomplete information for reliable invocation.

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?

The description adds minimal value beyond the input schema, which has 100% coverage. It mentions '根据项目名称' (based on project name), aligning with the schema's single parameter 'projectName'. However, it doesn't provide additional context like format constraints, examples, or edge cases. With high schema coverage, the baseline score of 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.

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: '根据项目名称查询项目基本信息' (query basic project information based on project name). It specifies the verb '查询' (query) and resource '项目基本信息' (basic project information), and lists the specific fields returned: start date, description, investment amount, and current progress. However, it doesn't explicitly distinguish this tool from sibling tools like 'get_project_all' or 'get_project_count', which likely have overlapping functionality.

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 sibling tools like 'get_project_all' (which might return all projects) or 'get_project_count' (which might return counts), nor does it specify prerequisites, exclusions, or contextual triggers for usage. The agent must infer usage from the tool name and description 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/sweetwisdom/mcp-demo'

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