MCPcopy
hub / github.com/smittix/intercept / proxy_mode_data

Function proxy_mode_data

routes/controller.py:468–491  ·  view source on GitHub ↗

Get current data from a remote agent.

(agent_id: int, mode: str)

Source from the content-addressed store, hash-verified

466
467@controller_bp.route('/agents/<int:agent_id>/<mode>/data', methods=['GET'])
468def proxy_mode_data(agent_id: int, mode: str):
469 """Get current data from a remote agent."""
470 agent = get_agent(agent_id)
471 if not agent:
472 return api_error('Agent not found', 404)
473
474 try:
475 client = create_client_from_agent(agent)
476 result = client.get_mode_data(mode)
477
478 # Tag data with agent info
479 result['agent_id'] = agent_id
480 result['agent_name'] = agent['name']
481
482 return jsonify({
483 'status': 'success',
484 'agent_id': agent_id,
485 'agent_name': agent['name'],
486 'mode': mode,
487 'data': result
488 })
489
490 except (AgentHTTPError, AgentConnectionError) as e:
491 return api_error(f'Agent error: {e}', 502)
492
493
494@controller_bp.route('/agents/<int:agent_id>/<mode>/stream')

Callers

nothing calls this directly

Calls 4

get_agentFunction · 0.90
api_errorFunction · 0.90
create_client_from_agentFunction · 0.90
get_mode_dataMethod · 0.45

Tested by

no test coverage detected