Skip to main content
Glama

create_library

Organize astronomical papers into custom collections by topic, project, or reading status using the NASA ADS system.

Instructions

Create a new paper library/collection. Useful for organizing papers by topic, project, or reading status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the library (e.g., 'Stellar Populations Review')
descriptionNoDescription of the library
publicNoWhether the library should be public (default: false)

Implementation Reference

  • The main handler function that executes the create_library tool logic: POSTs to ADS API /biblib/libraries endpoint with name, description, public params, returns success message with new library ID or error.
    async def create_library(name: str, description: str = "", public: bool = False) -> list[TextContent]: """Create a new library.""" try: payload = { "name": name, "description": description, "public": public } response = requests.post( f"{ADS_API_BASE}/biblib/libraries", headers=HEADERS, json=payload, timeout=30 ) response.raise_for_status() data = response.json() library_id = data.get("id") return [TextContent( type="text", text=f"✓ Created library '{name}'\nLibrary ID: {library_id}\n\nUse add_to_library to add papers to this library." )] except Exception as e: logger.error(f"Error creating library: {e}") return [TextContent( type="text", text=f"Error creating library: {str(e)}" )]
  • Pydantic/input schema defining the expected input parameters for the create_library tool.
    inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Name for the library (e.g., 'Stellar Populations Review')", }, "description": { "type": "string", "description": "Description of the library", }, "public": { "type": "boolean", "description": "Whether the library should be public (default: false)", "default": False, }, }, "required": ["name"], },
  • Registration of the create_library tool in the list_tools() function, including name, description, and input schema.
    Tool( name="create_library", description=( "Create a new paper library/collection. " "Useful for organizing papers by topic, project, or reading status." ), inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Name for the library (e.g., 'Stellar Populations Review')", }, "description": { "type": "string", "description": "Description of the library", }, "public": { "type": "boolean", "description": "Whether the library should be public (default: false)", "default": False, }, }, "required": ["name"], }, ),
  • Dispatch logic in the main call_tool handler that routes 'create_library' calls to the implementation function with parsed arguments.
    elif name == "create_library": return await create_library( name=arguments["name"], description=arguments.get("description", ""), public=arguments.get("public", False) )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prtc/nasa-ads-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server