Tools in your process
A function in Python
In Agents you passed a Python function in tools=[]. The agent runs it inside the same process.
MCP is for tools that live in another program. The pattern in the Agent is the same; only the source of the tool changes.
Example
from praisonai import Agent
def word_count(text: str) -> str:
"""Count the words in text."""
return str(len(text.split()))
agent = Agent(instructions="Use word_count when asked.", tools=[word_count])
print(agent.start("How many words in: one two three"))Example explained
- tools — In-process tools you define yourself.
Before MCP
Master in-process tools first — MCP only replaces where the tool runs.
Example
from praisonai import Agent
def upper(text: str) -> str:
return text.upper()
def word_count(text: str) -> str:
return str(len(text.split()))
agent = Agent(instructions="Use upper then word_count when asked.", tools=[upper, word_count])
print(agent.start("Count words in: ship mcp later"))Reference: documentation