Use this skill when the user asks for Wikipedia facts, summaries, related pages, or media links.
Workflow:
- •Pick
language(defaulten). - •Normalize titles:
- •trim spaces
- •replace spaces with
_ - •URL encode when needed
- •If the title is uncertain → search first.
- •Use
action_run_commandwithcurl -s <url>. - •Retry once using search if a page endpoint fails.
- •Return concise results with the final Wikipedia URL.
Supported endpoint patterns:
- •Search titles: https://{language}.wikipedia.org/w/rest.php/v1/search/title?q={query}&limit={limit}
- •Summary: https://{language}.wikipedia.org/api/rest_v1/page/summary/{title}
- •Full text extract (JSON): https://{language}.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&explaintext=1&redirects=1&titles={title}
- •Related pages: https://{language}.wikipedia.org/api/rest_v1/page/related/{title}
- •Media list: https://{language}.wikipedia.org/api/rest_v1/page/media-list/{title}
- •Random summary: https://{language}.wikipedia.org/api/rest_v1/page/random/summary
When to use each endpoint:
- •Search titles → when user gives a topic/name but title may be wrong or ambiguous.
- •Summary → default for “who is / what is”.
- •Full text extract → when user asks for full article or detailed info.
- •Related pages → when user asks for similar or connected topics.
- •Media list → when user asks for images/media.
- •Random summary → when user asks for a random Wikipedia article.
Input expectations:
- •Search requires
query; optionallimit(default 5). - •Page endpoints require
title.
Canonical article link format: https://{language}.wikipedia.org/wiki/{Title_With_Underscores}
Error handling:
- •If HTTP status is not 200:
- •Run title search using the same input.
- •Retry the page endpoint using the top result title.
- •If still failing, return a short failure reason and show search results.