You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Retrieve wiki page content by wikiIdentifier and path.",
123
+
"Retrieve wiki page content. Provide either a 'url' parameter OR the combination of 'wikiIdentifier' and 'project' parameters.",
124
124
{
125
-
wikiIdentifier: z.string().describe("The unique identifier of the wiki."),
126
-
project: z.string().describe("The project name or ID where the wiki is located."),
127
-
path: z.string().describe("The path of the wiki page to retrieve content for."),
125
+
url: z
126
+
.string()
127
+
.optional()
128
+
.describe(
129
+
"The full URL of the wiki page to retrieve content for. If provided, wikiIdentifier, project, and path are ignored. Supported patterns: https://dev.azure.com/{org}/{project}/_wiki/wikis/{wikiIdentifier}?pagePath=%2FMy%20Page and https://dev.azure.com/{org}/{project}/_wiki/wikis/{wikiIdentifier}/{pageId}/Page-Title"
130
+
),
131
+
wikiIdentifier: z.string().optional().describe("The unique identifier of the wiki. Required if url is not provided."),
132
+
project: z.string().optional().describe("The project name or ID where the wiki is located. Required if url is not provided."),
133
+
path: z.string().optional().describe("The path of the wiki page to retrieve content for. Optional, defaults to root page if not provided."),
return{content: [{type: "text",text: "Error fetching wiki page content: Provide either 'url' OR 'wikiIdentifier' with 'project', not both."}],isError: true};
141
+
}
142
+
if(!hasUrl&&!hasPair){
143
+
return{content: [{type: "text",text: "Error fetching wiki page content: You must provide either 'url' OR both 'wikiIdentifier' and 'project'."}],isError: true};
144
+
}
131
145
constconnection=awaitconnectionProvider();
132
146
constwikiApi=awaitconnection.getWikiApi();
147
+
letresolvedProject=project;
148
+
letresolvedWiki=wikiIdentifier;
149
+
letresolvedPath: string|undefined=path;
150
+
letpageContent: string|undefined;
151
+
152
+
if(url){
153
+
constparsed=parseWikiUrl(url);
154
+
if("error"inparsed){
155
+
return{content: [{type: "text",text: `Error fetching wiki page content: ${parsed.error}`}],isError: true};
0 commit comments