High-code applications integrate various tools via the MCP (Model Context Protocol) to extend AI Agent capabilities—such as knowledge retrieval, external service invocation, and application orchestration.
Overview
On the Tools page of a high-code application’s detail view, you can add and manage tools used by your Agent. While added tools are displayed for reference, their actual invocation logic must be implemented in code using the MCP protocol.
Tools added in the console serve primarily for visualization and management. The real tool-calling logic must be implemented in your code using the MCP protocol.
| Tool Type | Description | Use Cases |
|---|---|---|
| Knowledge Base | A configured knowledge base published as an MCP service, providing supplemental domain-specific knowledge to improve response accuracy. | Product documentation Q&A, enterprise knowledge search, automated FAQ responses—any scenario requiring specialized domain knowledge. |
| MCP Service | MCP services obtained either from the MCP Plaza or via plugin conversion, granting Agents new functional capabilities. | Web search, weather lookup, financial data analysis, enterprise business registration queries—external service invocation scenarios. |
| Application Component | Existing Agents or workflows integrated as reusable components to enhance current Agent functionality. | Multi-Agent collaboration, complex task orchestration, reusing existing workflows in high-code applications. |
Recommended Project Structure
A well-structured high-code application project is recommended to follow this layout: tool_use_demo.zip.
requirements.txt, use == to pin exact versions for all dependencies—avoid version ranges like >=. Pinning versions ensures consistent dependency environments across builds and prevents failures or runtime issues caused by upstream dependency updates.
Integration Workflow
Integrating tools into a high-code application involves three steps:
Step 1: Add Tools
On the Tools page of your high-code application, select the desired tool type (Knowledge Base, MCP Service, or Application Component), click the + button in its section, and search for and add the tool in the pop-up panel.
Step 2: Code IntegrationAfter adding a tool, the system automatically injects relevant environment variables. In your code, use
fastmcp.Client to connect to the MCP service and invoke the tool. Example:
Redeploy your application to activate the newly added tools. Then verify correct tool invocation using the API Test panel or the text-based chat interface on the right.
Knowledge Base
A knowledge base provides domain-specific supplementary knowledge to Agents, improving response accuracy. To be callable by a high-code application, a knowledge base must first be published as an MCP service.
Adding a Knowledge Base
On the Tools page, under the Knowledge Base section, click + to open the knowledge base selection panel.
Search or browse existing knowledge bases and click Add to associate one with your application. To create a new knowledge base, click Create Knowledge Base.
Once added, the knowledge base appears in the tool list. Switch to the Added tab to view all currently associated knowledge bases.
Code Integration Example
MCP Service
MCP services empower Agents with external capabilities. You can enable pre-built services from the MCP Plaza—or build custom MCP services or convert existing plugins.
Adding an MCP Service
On the Tools page, under the MCP Service section, click + to open the MCP service selection panel.
Select the source of your MCP service:
- MCP Plaza: Browse and enable platform-provided MCP services (e.g., web search, financial data analysis, enterprise registration lookup). Filter by “Enabled” or “Not Enabled.”
- Custom MCP: Add your own MCP service, or convert an existing plugin into an MCP service using Plugin → MCP.
Code Integration Example
Application Component
Application components let you embed previously built Agents or workflows as sub-components into your current high-code application—enabling multi-Agent collaboration and complex task orchestration.
Adding an Application Component
On the Tools page, under the Application Component section, click + to open the component selection panel.
Search or browse existing Agents and workflow applications, then click Add to integrate them as components. To create a new application, click Create Application.
Once added, view all associated application components under the Added tab.
Code Integration Example
Key Considerations for MCP Protocol Development
All tools integrate via the MCP (Model Context Protocol). Below are critical best practices when developing MCP tools.
Tool Naming & Description
The function name and docstring directly influence how large models decide when to invoke the tool. Be precise and descriptive about functionality and use cases.
Parameter Definition
Provide explicit type annotations and detailed parameter descriptions to help large models correctly extract and pass arguments.
Error Handling
Handle exceptions gracefully and return meaningful error messages—never let uncaught exceptions break the conversation flow.
Environment Variables
After adding tools, the system automatically injects connection details as environment variables. Commonly used ones include:
| Environment Variable | Description |
|---|---|
DASHSCOPE_API_KEY | Bailing Platform API key, required for calling model and tool APIs. |
DASHSCOPE_API_HEADERS | Additional headers included in API requests. |
PATH | System path variable containing Python runtime paths. |
PYTHONPATH | Python module search path. |
TZ | Timezone setting. |
Frequently Asked Questions
Q: What is the relationship between tools added in the console and those implemented in code?A: Console-added tools serve for visualization and managing associations—and trigger automatic injection of related environment variables. Actual tool invocation logic must be implemented in code using the MCP protocol. Q: How do I integrate a knowledge base into a high-code application?
A: First create and configure the knowledge base on Bailing Platform, then add it to your application via the Tools page. Once added, the system injects connection details (e.g., endpoint, ID), and you implement retrieval logic in code using
fastmcp.Client to call its MCP service.
Q: How do I use MCP Plaza services?A: Locate the desired service in the MCP Plaza, click Enable Now, then add it to your application via the Tools page. Enabled services expose standardized interfaces—you retrieve connection info from environment variables and invoke them in code. Q: Do I need to redeploy after adding or removing tools?
A: Yes. Redeployment is required for newly injected environment variables and updated tool configurations to take effect. Q: Why is the tool’s
description so important?A: Large models rely on the
description to determine when to call a tool. It should clearly state the tool’s purpose, applicable scenarios, and input/output behavior. Avoid vague descriptions like “search tool”—they hinder accurate tool selection.