Archon icon indicating copy to clipboard operation
Archon copied to clipboard

Update agent code to use new MCP tool functions

Open Wirasm opened this issue 4 months ago • 1 comments

Summary

The MCP server tools have been refactored in PR #421 to use individual functions instead of action-based patterns, but the agent code still references the old non-existent functions.

Problem

The following files still use old function patterns that no longer exist:

  • python/src/agents/mcp_client.py - Contains methods like manage_project() and manage_task()
  • python/src/agents/document_agent.py - Calls these deprecated methods

Current (incorrect) pattern:

# In mcp_client.py
async def manage_project(self, action: str, **kwargs) -> str:
    result = await self.call_tool("manage_project", action=action, **kwargs)
    
async def manage_task(self, action: str, project_id: str, **kwargs) -> str:
    result = await self.call_tool("manage_task", action=action, project_id=project_id, **kwargs)

Should be updated to:

# Use the new individual functions
async def create_project(self, title: str, description: str = "", **kwargs) -> str:
    result = await self.call_tool("create_project", title=title, description=description, **kwargs)

async def update_task(self, task_id: str, **kwargs) -> str:
    result = await self.call_tool("update_task", task_id=task_id, **kwargs)
# etc...

Affected Files

  • python/src/agents/mcp_client.py (lines 122-137)
  • python/src/agents/document_agent.py (lines 458, 583)

New MCP Tool Functions Available

Task Management

  • create_task(project_id, title, description, ...)
  • list_tasks(filter_by, filter_value, ...)
  • get_task(task_id)
  • update_task(task_id, title, status, ...)
  • delete_task(task_id)

Project Management

  • create_project(title, description, ...)
  • list_projects()
  • get_project(project_id)
  • update_project(project_id, title, ...)
  • delete_project(project_id)

Document Management

  • create_document(project_id, title, document_type, ...)
  • list_documents(project_id)
  • get_document(project_id, doc_id)
  • update_document(project_id, doc_id, ...)
  • delete_document(project_id, doc_id)

Related PRs

  • #421 - MCP tools refactoring that introduced the new function patterns

Priority

Medium - The agent code is not currently used in the main workflow, but should be updated for consistency and future use.

Wirasm avatar Aug 21 '25 17:08 Wirasm

This is not a priority until we activate the agent itself

Wirasm avatar Sep 04 '25 13:09 Wirasm