Spaces:
Running
Running
Commit
·
331ca47
1
Parent(s):
35da243
Refactor MCP API key handling in documentation and validation logic
Browse files- api_monitor.py +6 -6
api_monitor.py
CHANGED
@@ -121,7 +121,7 @@ def validate_api_configuration(
|
|
121 |
5. If sample_response looks valid: Use config_id in activate_monitoring() to activate monitoring
|
122 |
|
123 |
ARGUMENTS:
|
124 |
-
- mcp_api_key: MCP API key serves as user identifier.
|
125 |
- name: User-friendly name for the monitoring task
|
126 |
- description: Description of what is being monitored
|
127 |
- method: HTTP method (GET, POST, PUT, DELETE)
|
@@ -183,7 +183,7 @@ def validate_api_configuration(
|
|
183 |
try:
|
184 |
# Validate input parameters
|
185 |
if not mcp_api_key or not mcp_api_key.strip() or mcp_api_key == "":
|
186 |
-
mcp_api_key = os.
|
187 |
if not mcp_api_key or not mcp_api_key.strip():
|
188 |
return {
|
189 |
"success": False,
|
@@ -381,7 +381,7 @@ async def activate_monitoring(config_id, mcp_api_key):
|
|
381 |
|
382 |
ARGUMENTS:
|
383 |
- config_id: The ID from successful validate_api_configuration() execution (required)
|
384 |
-
- mcp_api_key: User's MCP API key for verification (must match validation step).
|
385 |
|
386 |
Input Examples:
|
387 |
|
@@ -435,7 +435,7 @@ async def activate_monitoring(config_id, mcp_api_key):
|
|
435 |
# attempt to create the scheduler
|
436 |
try:
|
437 |
if not mcp_api_key or not mcp_api_key.strip() or mcp_api_key == "":
|
438 |
-
mcp_api_key = os.
|
439 |
if not mcp_api_key or not mcp_api_key.strip():
|
440 |
return {
|
441 |
"success": False,
|
@@ -688,7 +688,7 @@ def retrieve_monitored_data(config_id, mcp_api_key, mode="summary"):
|
|
688 |
|
689 |
ARGUMENTS:
|
690 |
- config_id: The ID of the API configuration to retrieve data for (required)
|
691 |
-
- mcp_api_key: User's MCP API key for verification (must match validation step).
|
692 |
- mode: Data return mode - "summary" (LLM-optimized), "details" (full responses, minimal metadata), "full" (everything)
|
693 |
|
694 |
Input Examples:
|
@@ -770,7 +770,7 @@ def retrieve_monitored_data(config_id, mcp_api_key, mode="summary"):
|
|
770 |
"""
|
771 |
try:
|
772 |
if not mcp_api_key or not mcp_api_key.strip() or mcp_api_key == "":
|
773 |
-
mcp_api_key = os.
|
774 |
if not mcp_api_key or not mcp_api_key.strip():
|
775 |
return {
|
776 |
"success": False,
|
|
|
121 |
5. If sample_response looks valid: Use config_id in activate_monitoring() to activate monitoring
|
122 |
|
123 |
ARGUMENTS:
|
124 |
+
- mcp_api_key: MCP API key serves as user identifier.
|
125 |
- name: User-friendly name for the monitoring task
|
126 |
- description: Description of what is being monitored
|
127 |
- method: HTTP method (GET, POST, PUT, DELETE)
|
|
|
183 |
try:
|
184 |
# Validate input parameters
|
185 |
if not mcp_api_key or not mcp_api_key.strip() or mcp_api_key == "":
|
186 |
+
mcp_api_key = os.getenv("MCP_API_KEY", "")
|
187 |
if not mcp_api_key or not mcp_api_key.strip():
|
188 |
return {
|
189 |
"success": False,
|
|
|
381 |
|
382 |
ARGUMENTS:
|
383 |
- config_id: The ID from successful validate_api_configuration() execution (required)
|
384 |
+
- mcp_api_key: User's MCP API key for verification (must match validation step).
|
385 |
|
386 |
Input Examples:
|
387 |
|
|
|
435 |
# attempt to create the scheduler
|
436 |
try:
|
437 |
if not mcp_api_key or not mcp_api_key.strip() or mcp_api_key == "":
|
438 |
+
mcp_api_key = os.getenv("MCP_API_KEY", "")
|
439 |
if not mcp_api_key or not mcp_api_key.strip():
|
440 |
return {
|
441 |
"success": False,
|
|
|
688 |
|
689 |
ARGUMENTS:
|
690 |
- config_id: The ID of the API configuration to retrieve data for (required)
|
691 |
+
- mcp_api_key: User's MCP API key for verification (must match validation step).
|
692 |
- mode: Data return mode - "summary" (LLM-optimized), "details" (full responses, minimal metadata), "full" (everything)
|
693 |
|
694 |
Input Examples:
|
|
|
770 |
"""
|
771 |
try:
|
772 |
if not mcp_api_key or not mcp_api_key.strip() or mcp_api_key == "":
|
773 |
+
mcp_api_key = os.getenv("MCP_API_KEY", "")
|
774 |
if not mcp_api_key or not mcp_api_key.strip():
|
775 |
return {
|
776 |
"success": False,
|