Skip to content

Commit fa3aeee

Browse files
committed
tuto
1 parent c62048e commit fa3aeee

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

tutorial/mcp_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def main():
4242
tools
4343
)
4444
resp = await agent.ainvoke(
45-
{"messages": [{"role": "user", "content": "How can I get the uniprot ID for HBB?"}]}
45+
{"messages": [{"role": "user", "content": "Get the uniprot ID for HBB by executing a SPARQL query."}]}
4646
)
4747
print(resp)
4848

tutorial/mcp_server.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def execute_sparql_query(sparql_query: str, endpoint_url: str) -> str:
142142
"""
143143
resp_msg = ""
144144
try:
145-
res = query_sparql(sparql_query, endpoint_url, timeout=10, check_service_desc=False, post=True)
145+
res = query_sparql(sparql_query, endpoint_url, timeout=10, post=True)
146146
# If no results, return a message to ask fix the query
147147
if not res.get("results", {}).get("bindings"):
148148
resp_msg += f"SPARQL query returned no results. {FIX_QUERY_PROMPT}\n```sparql\n{sparql_query}\n```"
@@ -163,11 +163,11 @@ def execute_sparql_query(sparql_query: str, endpoint_url: str) -> str:
163163
and check them one by one."""
164164

165165

166-
# https://modelcontextprotocol.io/docs/concepts/resources
167-
@mcp.resource("examples://{question}")
168-
def get_examples(question: str) -> str:
169-
"""Get relevant SPARQL query examples and other documents to help the user write a SPARQL query."""
170-
return access_sib_biodata_sparql(question, [], [])
166+
# # https://modelcontextprotocol.io/docs/concepts/resources
167+
# @mcp.resource("examples://{question}")
168+
# def get_examples(question: str) -> str:
169+
# """Get relevant SPARQL query examples and other documents to help the user write a SPARQL query."""
170+
# return access_sib_biodata_sparql(question, [], [])
171171

172172

173173
def main() -> None:

tutorial/uv.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)