Skip to content

Commit 842f1d2

Browse files
feat: Add test-my-tools prompt for MCP server testing (#196)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent cabdc71 commit 842f1d2

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

connector_builder_mcp/_guidance/prompts.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,3 +323,24 @@
323323
324324
**Warning**: Creative mode is less reliable and may lead to mistakes. Use only for complex scenarios.
325325
"""
326+
327+
TEST_MY_TOOLS_GUIDANCE = """
328+
Test all available tools in this MCP server to confirm they are working properly.
329+
330+
Guidelines:
331+
- Iterate through each tool systematically
332+
- Use read-only operations whenever possible
333+
- For tools that modify data, use test/safe modes or skip if no safe testing method exists
334+
- Avoid creating persistent side effects (e.g., don't create real resources, connections, or data)
335+
- Document which tools were tested and their status
336+
- Report any errors or issues encountered
337+
- Provide a summary of the test results at the end
338+
339+
Focus on validating that tools:
340+
1. Accept their required parameters correctly
341+
2. Return expected output formats
342+
3. Handle errors gracefully
343+
4. Connect to required services (if applicable)
344+
345+
Be efficient and practical in your testing approach.
346+
""".strip()

connector_builder_mcp/build_strategies/declarative_yaml_v1/prompts.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
CONNECTOR_BUILD_PROMPT,
1616
CREATIVE_MODE_NOTE,
1717
NON_CREATIVE_MODE_NOTE,
18+
TEST_MY_TOOLS_GUIDANCE,
1819
)
1920
from connector_builder_mcp.mcp._mcp_utils import (
2021
ToolDomain,
@@ -111,6 +112,25 @@ def add_stream_to_connector(
111112
return [{"role": "user", "content": content}]
112113

113114

115+
@mcp_prompt(
116+
name="test-my-tools",
117+
description="Test all available MCP tools to confirm they are working properly",
118+
domain=ToolDomain.PROMPTS,
119+
)
120+
def test_my_tools_prompt() -> list[dict[str, str]]:
121+
"""Generate a prompt that instructs the agent to test all available tools.
122+
123+
Returns:
124+
List containing a single message dict with the guidance text
125+
"""
126+
return [
127+
{
128+
"role": "user",
129+
"content": TEST_MY_TOOLS_GUIDANCE,
130+
}
131+
]
132+
133+
114134
def register_prompts(app: FastMCP) -> None:
115135
"""Register connector builder prompts with the FastMCP app.
116136

0 commit comments

Comments
 (0)