Get Resources • AI Agent SDK

get_resources: List resources/resource-templates advertised by the MCP server.

get_resources

Method

</div>

This is a method of the MCP class in the mcp module.

List resources/resource-templates advertised by the MCP server.

Returns an empty list for transports that do not surface resources or for tools-only servers.

Signature

python
def get_resources() -> List[dict]

Returns

ResponseField List[dict]

Serialised resource and resource-template descriptors.

Uses

  • _res.resources_to_dicts
  • _res.resource_templates_to_dicts

Source

View on GitHub

praisonaiagents/mcp/mcp.py at line 1334