list_libraries
Retrieve your personal paper libraries from NASA ADS, showing library names, descriptions, and paper counts for organized research management.
Instructions
List all your personal paper libraries/collections in ADS. Shows library names, descriptions, and paper counts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/nasa_ads_mcp/server.py:651-687 (handler)The main handler function for the 'list_libraries' tool. Fetches and lists the user's personal paper libraries from the NASA ADS API.async def list_libraries() -> list[TextContent]: """List all user libraries.""" try: response = requests.get( f"{ADS_API_BASE}/biblib/libraries", headers=HEADERS, timeout=30 ) response.raise_for_status() data = response.json() libraries = data.get("libraries", []) if not libraries: return [TextContent( type="text", text="No libraries found. Create one with the create_library tool!" )] lib_lines = ["Your ADS Libraries:\n"] for lib in libraries: lib_lines.append( f"• {lib.get('name', 'Unnamed')} (ID: {lib.get('id', 'unknown')})\n" f" {lib.get('description', 'No description')}\n" f" Papers: {lib.get('num_documents', 0)} | " f"{'Public' if lib.get('public') else 'Private'}\n" ) return [TextContent(type="text", text="\n".join(lib_lines))] except Exception as e: logger.error(f"Error listing libraries: {e}") return [TextContent( type="text", text=f"Error listing libraries: {str(e)}" )]
- src/nasa_ads_mcp/server.py:182-192 (registration)Registers the 'list_libraries' tool in the MCP server's list_tools() method, including its name, description, and empty input schema (no parameters required).Tool( name="list_libraries", description=( "List all your personal paper libraries/collections in ADS. " "Shows library names, descriptions, and paper counts." ), inputSchema={ "type": "object", "properties": {}, }, ),
- src/nasa_ads_mcp/server.py:188-192 (schema)The input schema for the 'list_libraries' tool, which requires no input parameters.inputSchema={ "type": "object", "properties": {}, }, ),
- src/nasa_ads_mcp/server.py:294-295 (handler)Dispatch logic in the main call_tool handler that routes 'list_libraries' calls to the specific implementation function.elif name == "list_libraries": return await list_libraries()