Skip to main content
Glama
sweetwisdom

MCP Project Query Server

by sweetwisdom

get_project_count

Retrieve the total number of projects managed by the MCP Project Query Server to monitor project inventory and track system usage.

Instructions

获取项目总数

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the MCP tool 'get_project_count' with empty input schema and a handler that delegates to ProjectController.getProjectCount().
    server.tool( 'get_project_count', '获取项目总数', {}, async () => { return projectController.getProjectCount(); } );
  • The main handler function for the tool, retrieves project count from service and formats it as an MCP response with text content.
    getProjectCount(): { content: Array<{ type: "text"; text: string }> } { const count = this.projectService.getProjectCount(); return { content: [ { type: 'text', text: `项目总数: ${count}`, }, ], }; }
  • Helper method in ProjectService that delegates the project count retrieval to the repository.
    getProjectCount(): number { return this.projectRepository.getProjectCount(); }
  • Core implementation in ProjectRepository that returns the length of the in-memory projects array.
    getProjectCount(): number { return this.projects.length; }

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