Retrieve ID
Tool for retrieving a Semantic Scholar paper ID given a paper title.
This tool queries the Semantic Scholar API for the best match of the provided paper title
and returns the unique Semantic Scholar paperId. Use when you have a known title and need its
Semantic Scholar identifier for further metadata retrieval or pipeline integration. Do not
use this tool for broad literature search; use the search
tool instead.
RetrieveSemanticScholarPaperIdInput
Bases: BaseModel
Pydantic schema for retrieving a Semantic Scholar paper ID.
Fields
paper_title: The title (full or partial) of the paper to look up on Semantic Scholar. tool_call_id: LangGraph-injected identifier for tracking the tool invocation.
Source code in aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py
28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
retrieve_semantic_scholar_paper_id(paper_title, tool_call_id)
Search for a paper by title on Semantic Scholar and return its unique paper ID.
This tool issues a GET request to the Semantic Scholar API to find the best match for the given paper title, then returns the paper's Semantic Scholar ID.
Use when you have a known title (full or partial) and need the Semantic Scholar ID
to fetch additional metadata or perform downstream lookups. Do not use this tool
for broad literature searches; for general search use the search
tool.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
paper_title
|
str
|
The title of the paper to look up. |
required |
tool_call_id
|
str
|
LangGraph-injected identifier for this tool call. |
required |
Returns:
Name | Type | Description |
---|---|---|
Command |
Command[Any]
|
A structured response containing a ToolMessage whose content is the Semantic Scholar paper ID string (e.g., 'abc123xyz'). |
Raises:
Type | Description |
---|---|
ValueError
|
If no matching paper is found for the given title. |
RequestException
|
If the API request fails. |
Source code in aiagents4pharma/talk2scholars/tools/s2/retrieve_semantic_scholar_paper_id.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|