tencent cloud

Cloud Native Intelligent Gateway

Configuration Rewriting

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-09-22 18:47:46
AI 번역

Scenarios

When you encapsulate an existing RESTful API as an MCP tool using the HTTP-to-MCP method, the parameter structure exposed by the tool often does not match the actual message format of the backend API. With the Dynamic Message Adjustment feature, you can rename, locate, inject fixed values, and template-rewrite the tool's request parameters and response content without modifying the backend service. This makes the input and output of the MCP tool better align with the calling conventions of large language models.

Prerequisites

The cloud-native AI gateway instance has been created.
The HTTP-to-MCP type MCP Server and its tools have been created.

Operation Steps

1. Log in to the Microservices Platform console. In the left sidebar, click AI Gateway > Instance List.
2. On the instance list page, click the ID of the gateway instance you want to configure to go to its basic information page.
3. In the left sidebar, click MCP Management. In the service list, click the ID/Name of the target HTTP-to-MCP service to go to the service details page.
4. On the service details page, click the Tools Management tab at the top. On the Tools list page, select the target Tool to go to the Tool Basic Information page.
5. On the tool details page, select the Parameter Rewriting tab, and then click Configure Parameter Rewriting.
Request Parameter Rewriting:
Parameter Renaming: Maps the external parameters to the actual field names in the backend (backend field names).
Parameter Position: Specifies the location of the parameter in the backend request (such as Query, Header, and Body).
Fixed Injection Fields (InjectFields): Injects fixed-value fields into backend requests (such as fixed authentication headers and channel identifiers).
Response Template Rewriting:
Response Template (Response Body): Uses GJSON syntax to extract and restructure the returned content from the backend response.
Error Response Template: The content returned to the client in custom error scenarios.
6. Click Save to apply the configuration.

Related Instructions

When configuring, observe the following restrictions:
Configuration Item
Valid Range / Limit
Number of tool parameters
≤ 20
Tag key length
≤ 128 characters
Tag value length
≤ 4096 characters
Request Body template length
≤ 16384 characters
Response Body template length
≤ 16384 characters
Error response template length
≤ 2048 characters
The response template uses GJSON syntax to extract fields. After configuration, it is recommended to verify in debugging whether the output meets expectations.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백