Code Review and Merge Management: Code and Change Review Assistance - Tool Calling and Plugins

Data for this category primarily comes from Git repositories, CI pipelines, static scanning reports, and defect databases. Daily associated business

This document applies to FastGPT v4.17.0, and covers tool calling and plugin configuration for code review and merge management scenarios.

What Data for This Category Looks Like

Data for this category primarily comes from Git repositories, CI pipelines, static scanning reports, and defect databases. Daily associated business documents include merge requests, code review comments, commit records, and branch strategy descriptions. Data updates occur daily or with each code commit. Data fields include merge request unique identifiers, commit hashes, review comment statuses, associated branch names, static scanning defect counts, and more. Some fields use text identifiers, while others use numerical counts. There are no uniform fixed units.

Constraints Imposed by These Characteristics on Tool Calling and Plugins

Dispersed data sources and update rhythms tightly tied to code commits require tool calling to adapt to incremental pull logic. This avoids repeated processing of full repository data. Fixed but diverse associated document structures require plugins to predefine parsing rules for documents such as merge requests and review comments. This enables accurate extraction of key review information. Data errors directly impact code merge quality. This requires tool calling to add pre-validation steps to block change requests that do not meet review requirements. High real-time data update requirements mean tool calling must minimize latency. This avoids delays to review workflows.

How to Configure Settings

Configuration ItemRecommended ApproachRationale
Tool trigger timingTrigger on code commit or merge request creation eventsMatches the update rhythm tightly tied to commits for this category of data, avoids ineffective scheduled calls
Tool call timeout period300–600 secondsAdapts to typical time consumption for Git repository pulls and CI log parsing, avoids timeout interruptions to review workflows
toolChoiceSet to autoLets the model independently select appropriate tools to handle review data pulling and validation, adapts to diverse document structures
Review data pull scopeOnly pull commits and static scanning reports associated with the current merge requestReduces invalid data loading, aligns with the merge request-based aggregation characteristic of this category of data
functionCallEnable and limit to code review validation functionsEnsures tool calling focuses on change impact assessment and review comment validation, avoids unrelated tool calls
Plugin permission scopeOnly grant read-only access to specified repositoriesMeets security requirements for code review scenarios, prevents unauthorized access to other repository data

Three Common Misconfigurations

  • Symptom: Code review statistical pie charts generated by tools fail to render correctly, displaying as plain text markdown code. Cause: Tool markdown rendering rules are not configured properly. This prevents correct parsing of the table format used for pie charts.
  • Symptom: Tool calls time out with a 504 status code, and returned review data fields are missing. Examples include missing commit records associated with merge requests. Cause: Review data pull scope is not configured correctly. Tool trigger timing is set to fixed scheduled pulls. This causes load time to exceed the preset timeout threshold, and fails to cover content associated with the current merge request.
  • Symptom: MCP services run via npx cannot be added to the tool set. Temporary activation status expires quickly. Communication logs show connection failures. Cause: Service parameters are not configured according to the service startup log format. FastGPT and MCP service communication ports are not configured correctly. This prevents establishment of a stable connection.

How to Confirm Correct Configuration

  • Manually trigger a tool call associated with a specified merge request. Check if returned results include the merge request's unique identifier, commit hash, and review comment status.
  • Review tool call logs. Confirm trigger timing matches code commit or merge request creation events. No ineffective scheduled pull records appear.
  • Check plugin permission configurations. Confirm only read-only access to specified code repositories is granted. No unauthorized access configuration items exist.
  • Test connection to the MCP service run via npx. Confirm the service status shows as activated. No communication error records appear.

The values provided here are common starting points. They should be evaluated against the respective deployment's own samples.

Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-10-19.