aiida_mcp.nodes module

Computer, code and node inspection tools.

aiida_mcp.nodes.get_node_content(pk: int) → dict[str, Any]

Return the content of a node, for node types where that is supported.

Parameters:

pk (int) – Primary key of the node.

Returns:

The node’s content. The exact shape depends on the node type; see _singlefile_content, _value_content, _dict_content and _array_content.

Return type:

dict[str, Any]

Raises:

ToolError – If no node exists with the given PK, or if its type has no registered content reader.

aiida_mcp.nodes.list_codes(computer: str | None = None, limit: int = 20) → dict[str, Any]

List codes, optionally only those on one computer.

Parameters:
  • computer (str or None) – Label of the computer to filter by, or None for all computers.

  • limit (int) – Maximum number of codes to return.

Returns:

The number of matching codes, the number returned, and a summary of each one.

Return type:

dict[str, Any]

aiida_mcp.nodes.list_computers() → dict[str, Any]

List all configured computers.

Returns:

The total number of computers and a summary of each one.

Return type:

dict[str, Any]

aiida_mcp.nodes.query_nodes(node_type: str | None = None, group: str | None = None, extra_key: str | None = None, limit: int = 20) → dict[str, Any]

Query nodes by type prefix, group label, and/or extras key.

Parameters:
  • node_type (str or None) – Node type prefix to filter by. A trailing % is optional.

  • group (str or None) – Label of a group to restrict results to.

  • extra_key (str or None) – Only include nodes that have this extras key.

  • limit (int) – Maximum number of nodes to return.

Returns:

The number of matching nodes, the number returned, and a summary of each one.

Return type:

dict[str, Any]

Raises:

ToolError – If group does not match any configured group.