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
Copy file name to clipboardExpand all lines: EssentialCSharp.Web/Tools/BookContentTool.cs
+2-11Lines changed: 2 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ public BookContentTool(
37
37
Description("Retrieve the prose content of a specific book section identified by its slug/key (e.g., 'hello-world', 'creating-editing-compiling-and-running-c-source-code'). Returns the section text with code examples preserved. Use GetChapterSections to discover available slugs.")]
38
38
publicasyncTask<string>GetSectionContent(
39
39
[Description("The section slug/key (e.g., 'hello-world'). Use GetChapterSections to get valid slugs.")]stringsectionKey,
40
-
[Description("Maximum number of characters to return (500–8000, default 4000). Long sections are truncated.")]intmaxChars=4000,
40
+
[Description("Maximum number of characters to return (500–8000). Long sections are truncated.")]intmaxChars=4000,
41
41
CancellationTokencancellationToken=default)
42
42
{
43
43
maxChars=Math.Clamp(maxChars,500,8000);
@@ -365,7 +365,7 @@ public string GetChapterSummary(
Description("Retrieve C# coding guidelines from the Essential C# book. Optionally filter by keyword, chapter number, or guideline type (do/consider/avoid/donot). The book contains guidelines covering naming conventions, error handling, LINQ, async/await, generics, and many other topics. Each guideline includes its chapter and subsection context.")]
21
+
Description("Retrieve C# coding guidelines from the Essential C# book. Filter by keyword (exact text match), chapter number, or guideline type. Use the 'topic' parameter for relevance-ranked discovery by concept (e.g., 'exception handling', 'naming', 'async'). Each guideline includes its chapter and subsection context. Tip: use 'topic' for broad discovery; use 'keyword' for precise text matching.")]
21
22
publicstringGetCSharpGuidelines(
22
-
[Description("Optional keyword to filter guidelines by (searched in guideline text and subsection name).")]string?keyword=null,
23
+
[Description("Optional keyword for exact-text search in guideline text and subsection name.")]string?keyword=null,
23
24
[Description("Optional chapter number to restrict results to a specific chapter.")]int?chapter=null,
[Description("Maximum number of guidelines to return (1–50, default 20).")]intmaxResults=20)
26
+
[Description("Optional topic or concept for relevance-ranked search (e.g., 'exception handling', 'naming', 'async'). Results are ordered by relevance. Use for broad discovery; use 'keyword' for exact text matching.")]string?topic=null,
27
+
[Description("Maximum number of guidelines to return (1–50).")]intmaxResults=20)
[McpServerTool(Title="Get Guidelines By Topic",ReadOnly=true,Destructive=false,Idempotent=true,OpenWorld=false),
71
-
Description("Search C# coding guidelines from the Essential C# book by topic or concept. More discoverable than filtering by chapter — finds all guidelines related to exceptions, naming, async, LINQ, generics, interfaces, and more. Results are ordered by relevance to the topic.")]
72
-
publicstringGetGuidelinesByTopic(
73
-
[Description("The topic or concept to search guidelines for (e.g., 'exception handling', 'naming', 'async', 'LINQ', 'generics', 'interface').")]stringtopic,
74
-
[Description("Maximum number of guidelines to return (1–30, default 15).")]intmaxResults=15)
Copy file name to clipboardExpand all lines: EssentialCSharp.Web/Tools/BookListingTool.cs
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,14 +39,21 @@ public async Task<string> GetListingSourceCode(
39
39
Description("Search all code listings in the Essential C# book for a specific code pattern, keyword, or identifier. Searches actual C# source code (not prose). Useful for finding examples of Task.WhenAll, yield return, IDisposable, pattern matching, and similar code constructs.")]
40
40
publicasyncTask<string>SearchListingsByCode(
41
41
[Description("The code pattern or keyword to search for in listing source code (case-insensitive substring match).")]stringpattern,
42
-
[Description("Maximum number of matching listings to return (1–20, default 10).")]intmaxResults=10,
42
+
[Description("Maximum number of matching listings to return (1–20).")]intmaxResults=10,
43
43
CancellationTokencancellationToken=default)
44
44
{
45
45
if(string.IsNullOrWhiteSpace(pattern))
46
46
{
47
47
return"Pattern must not be empty.";
48
48
}
49
49
50
+
stringtrimmedPattern=pattern.Trim();
51
+
boolisKnownOperator=trimmedPatternis"=>" or "??" or "?." or "::" or "??=" or "==" or "!=" or "<=" or ">=" or "&&" or "||";
Copy file name to clipboardExpand all lines: EssentialCSharp.Web/Tools/BookSearchTool.cs
+5-14Lines changed: 5 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ public BookSearchTool(IServiceProvider serviceProvider, ISiteMappingService site
32
32
Description("Search the Essential C# book content using semantic vector search. Returns relevant text chunks with chapter and heading context. Use this to find information about C# programming concepts covered in the book.")]
33
33
publicasyncTask<string>SearchBookContent(
34
34
[Description("The search query describing the C# concept or topic to find in the book.")]stringquery,
35
-
[Description("Number of results to return (1–10). Default is 5. Use a higher value for broad topics or comprehensive research; lower for quick lookups.")]intmaxResults=AISearchService.DefaultSearchTop,
35
+
[Description("Number of results to return (1–10). Use a higher value for broad topics or comprehensive research; lower for quick lookups.")]intmaxResults=AISearchService.DefaultSearchTop,
36
36
CancellationTokencancellationToken=default)
37
37
{
38
38
if(string.IsNullOrWhiteSpace(query))
@@ -173,7 +173,7 @@ public string GetDirectContentUrl(
173
173
Description("Find all sections in the Essential C# book that cover a specific C# concept. Combines section heading search with semantic vector search (when available) to give broad coverage. Returns section slugs, chapter numbers, and direct links.")]
174
174
publicasyncTask<string>LookupConcept(
175
175
[Description("The C# concept, feature, or topic to find in the book (e.g., 'LINQ', 'async/await', 'pattern matching', 'generics').")]stringconcept,
176
-
[Description("Number of semantic search results to return (1–10). Default is 5.")]intmaxResults=AISearchService.DefaultSearchTop,
176
+
[Description("Number of semantic search results to return (1–10).")]intmaxResults=AISearchService.DefaultSearchTop,
177
177
CancellationTokencancellationToken=default)
178
178
{
179
179
if(string.IsNullOrWhiteSpace(concept))
@@ -404,7 +404,7 @@ public async Task<string> FindBookHelpForDiagnostic(
@@ -417,7 +417,7 @@ public async Task<string> FindBookHelpForDiagnostic(
417
417
Description("Find other sections in the Essential C# book that are semantically related to a given section. Uses the section heading as a search query to discover thematically connected content across the entire book. Requires AI services to be configured.")]
418
418
publicasyncTask<string>FindRelatedSections(
419
419
[Description("The section slug/key to find related content for (e.g., 'async-await'). Use GetChapterSections to get valid slugs.")]stringsectionKey,
420
-
[Description("Number of related sections to return (1–10). Default is 5.")]intmaxResults=AISearchService.DefaultSearchTop,
420
+
[Description("Number of related sections to return (1–10).")]intmaxResults=AISearchService.DefaultSearchTop,
421
421
CancellationTokencancellationToken=default)
422
422
{
423
423
if(string.IsNullOrWhiteSpace(sectionKey))
@@ -474,16 +474,7 @@ public async Task<string> FindRelatedSections(
0 commit comments