Skip to main content
Glama

history_list

Retrieve a list of recent team collaboration history records. Optionally specify the number of records to return.

Instructions

查看团队协作历史记录列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo返回记录数量,默认 10

Implementation Reference

  • Handler/execution block for the 'history_list' tool. It extracts the optional 'limit' parameter, calls historyManager.list() to get summaries, and returns formatted markdown via historyManager.formatList().
    case 'history_list': {
      const { limit } = args as { limit?: number };
      const summaries = historyManager.list(limit || 10);
      return {
        content: [
          {
            type: 'text',
            text: historyManager.formatList(summaries),
          },
        ],
      };
    }
  • Schema/registration of the 'history_list' tool definition in ListToolsRequestSchema. Defines the tool name, description, and input schema (optional 'limit' number parameter).
    {
      name: 'history_list',
      description: '查看团队协作历史记录列表',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: '返回记录数量,默认 10',
          },
        },
      },
    },
  • The HistoryManager.list() method that reads JSON files from the history directory, sorts them in reverse chronological order, and returns up to 'limit' HistorySummary objects.
    list(limit = 20): HistorySummary[] {
      if (!existsSync(this.historyDir)) {
        return [];
      }
    
      // 获取并排序文件
      const files = readdirSync(this.historyDir)
        .filter((f) => f.endsWith('.json'))
        .sort()
        .reverse()
        .slice(0, limit);
    
      // 读取并解析
      return files
        .map((file) => {
          try {
            const content = readFileSync(join(this.historyDir, file), 'utf-8');
            const entry = JSON.parse(content) as HistoryEntry;
            return {
              id: entry.id,
              timestamp: entry.timestamp,
              task: entry.task,
              summary: entry.summary,
              experts: entry.experts,
            };
          } catch {
            return null;
          }
        })
        .filter((e): e is HistorySummary => e !== null);
    }
  • The HistoryManager.formatList() method that formats a list of HistorySummary objects into a human-readable Markdown string.
    formatList(summaries: readonly HistorySummary[]): string {
      if (summaries.length === 0) {
        return '暂无协作历史记录';
      }
    
      const lines = ['## 📚 协作历史记录\n'];
    
      for (const entry of summaries) {
        const date = new Date(entry.timestamp).toLocaleString();
        const taskPreview =
          entry.task.length > TASK_PREVIEW_MAX_LENGTH
            ? `${entry.task.slice(0, TASK_PREVIEW_MAX_LENGTH)}...`
            : entry.task;
    
        lines.push(
          `- **${entry.id}** (${date})`,
          `  任务: ${taskPreview}`,
          `  专家: ${entry.experts.join(', ')}`,
          ''
        );
      }
    
      lines.push('\n使用 `history_get` 工具查看详情,传入 ID 即可。');
      return lines.join('\n');
    }
  • src/server.ts:120-403 (registration)
    Registration of all tools via ListToolsRequestSchema handler (the 'history_list' tool is registered among the tool list).
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'team_work',
          description:
            '让 AI 开发团队协作完成任务。团队包含前端专家、后端专家、QA专家,会智能分配任务并互相协作。',
          inputSchema: {
            type: 'object',
            properties: {
              task: {
                type: 'string',
                description: '任务描述,例如:帮我写一个用户登录功能',
              },
              context: {
                type: 'string',
                description: '额外的上下文信息(可选)',
              },
            },
            required: ['task'],
          },
        },
        {
          name: 'ask_expert',
          description: '向特定专家咨询问题',
          inputSchema: {
            type: 'object',
            properties: {
              expert: {
                type: 'string',
                enum: expertEnumInfo.enum,
                description: expertEnumInfo.description,
              },
              question: {
                type: 'string',
                description: '要咨询的问题',
              },
            },
            required: ['expert', 'question'],
          },
        },
        {
          name: 'code_review',
          description: '让专家审查代码',
          inputSchema: {
            type: 'object',
            properties: {
              code: {
                type: 'string',
                description: '要审查的代码',
              },
              reviewer: {
                type: 'string',
                enum: expertEnumInfo.enum,
                description: `审查者:${expertEnumInfo.description}`,
              },
              context: {
                type: 'string',
                description: '代码的背景信息(可选)',
              },
            },
            required: ['code', 'reviewer'],
          },
        },
        {
          name: 'fix_bug',
          description: '让 QA 专家修复 Bug',
          inputSchema: {
            type: 'object',
            properties: {
              code: {
                type: 'string',
                description: '有 Bug 的代码',
              },
              error: {
                type: 'string',
                description: '错误信息或 Bug 描述',
              },
            },
            required: ['code', 'error'],
          },
        },
        {
          name: 'history_list',
          description: '查看团队协作历史记录列表',
          inputSchema: {
            type: 'object',
            properties: {
              limit: {
                type: 'number',
                description: '返回记录数量,默认 10',
              },
            },
          },
        },
        {
          name: 'history_get',
          description: '获取某次协作的详细记录',
          inputSchema: {
            type: 'object',
            properties: {
              id: {
                type: 'string',
                description: '协作记录 ID',
              },
            },
            required: ['id'],
          },
        },
        {
          name: 'history_search',
          description: '搜索协作历史记录',
          inputSchema: {
            type: 'object',
            properties: {
              query: {
                type: 'string',
                description: '搜索关键词',
              },
              limit: {
                type: 'number',
                description: '返回记录数量,默认 10',
              },
            },
            required: ['query'],
          },
        },
        {
          name: 'history_context',
          description: '获取最近的协作上下文,可用于继续之前的工作',
          inputSchema: {
            type: 'object',
            properties: {
              count: {
                type: 'number',
                description: '获取最近几次协作,默认 3',
              },
            },
          },
        },
        {
          name: 'usage_stats',
          description: '查看各模型的使用统计(调用次数、成功率、平均耗时)',
          inputSchema: {
            type: 'object',
            properties: {},
          },
        },
        {
          name: 'team_dashboard',
          description: '查看团队当前状态:可用专家、模型配置、最近活动',
          inputSchema: {
            type: 'object',
            properties: {},
          },
        },
        {
          name: 'cost_estimate',
          description: '预估任务执行成本(Token 用量、预计耗时)',
          inputSchema: {
            type: 'object',
            properties: {
              task: {
                type: 'string',
                description: '要预估的任务描述',
              },
            },
            required: ['task'],
          },
        },
        {
          name: 'explain_plan',
          description: '解释 Tech Lead 会如何分配任务(不实际执行)',
          inputSchema: {
            type: 'object',
            properties: {
              task: {
                type: 'string',
                description: '要分析的任务描述',
              },
            },
            required: ['task'],
          },
        },
        {
          name: 'read_project_files',
          description: '读取项目文件内容,让专家了解代码上下文',
          inputSchema: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: '文件或目录路径(相对于当前工作目录)',
              },
              pattern: {
                type: 'string',
                description: '文件匹配模式(如 *.ts, *.js),仅读取目录时有效',
              },
              maxFiles: {
                type: 'number',
                description: '最多读取文件数(默认 10)',
              },
            },
            required: ['path'],
          },
        },
        {
          name: 'generate_commit_message',
          description: '根据代码变更生成 Git commit message',
          inputSchema: {
            type: 'object',
            properties: {
              diff: {
                type: 'string',
                description: '代码变更内容(git diff 输出)',
              },
              style: {
                type: 'string',
                enum: ['conventional', 'simple', 'detailed'],
                description: '提交信息风格:conventional(约定式)、simple(简洁)、detailed(详细)',
              },
            },
            required: ['diff'],
          },
        },
        {
          name: 'analyze_project_structure',
          description: '分析项目结构,识别技术栈和架构',
          inputSchema: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: '项目根目录路径(默认当前目录)',
              },
            },
          },
        },
        {
          name: 'list_workflows',
          description: '列出所有可用的工作流模板',
          inputSchema: {
            type: 'object',
            properties: {},
          },
        },
        {
          name: 'run_workflow',
          description: '使用指定工作流执行任务',
          inputSchema: {
            type: 'object',
            properties: {
              workflow: {
                type: 'string',
                enum: ['code-generation', 'bug-fix', 'refactoring', 'code-review', 'documentation'],
                description: '工作流 ID',
              },
              task: {
                type: 'string',
                description: '任务描述',
              },
              context: {
                type: 'string',
                description: '额外上下文(可选)',
              },
            },
            required: ['workflow', 'task'],
          },
        },
        {
          name: 'suggest_workflow',
          description: '根据任务自动推荐合适的工作流',
          inputSchema: {
            type: 'object',
            properties: {
              task: {
                type: 'string',
                description: '任务描述',
              },
            },
            required: ['task'],
          },
        },
      ],
    }));
Behavior2/5

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

No annotations provided, so the description must carry the full burden. It only states 'view list' without disclosing behavioral traits such as sorting, pagination beyond the limit parameter, authentication needs, or data scope (e.g., whether it returns all history or filtered).

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

Conciseness3/5

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

The description is a single sentence, which is concise but lacks structure. It communicates the core purpose without elaboration, but for a tool with one parameter, it is not overly verbose. However, it could be more structured with additional context.

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 that there is no output schema, the description should hint at the return format (e.g., list of records, fields included). It does not, leaving the agent uncertain about the response structure. The tool is simple, but the description is incomplete for effective 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 coverage is 100% for the single parameter 'limit', which already has a description ('返回记录数量,默认 10'). The description adds no additional meaning beyond what the schema provides, so the baseline of 3 is appropriate.

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 action (查看 ... 列表, view list) and resource (团队协作历史记录, team collaboration history). It is specific enough to distinguish from siblings like history_search or history_get, but does not explicitly differentiate them.

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 on when to use this tool versus alternatives. It lacks context about when to prefer history_list over history_search or history_get, and does not mention any prerequisites or exclusions.

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/7836246/claude-team-mcp'

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