mcp tips microsoft agent_framework tool

Some tips when working with agent_framework

Approve mode

Did you know we can use get away with those manual approval everytime an agent call a remote tool with "approval_mode=never_required" - here is an example code snippet that allows us to do this.



@tool(description="List files in a directory.", approval_mode="never_require")
def list_files(directory: str) -> list[str]:
    """List files in a directory."""
    try:
        return os.listdir(directory)
    except Exception as e:
        return [f"Error listing files in {directory}: {e}"]

   

Azure Foundry Toolkit 






Comments

Popular posts from this blog

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

llama cpp running it in google colab