get-navigation-patterns
Retrieve Expo Router navigation patterns for implementing routes, navigation, deep links, and auth guards in React Native projects.
Instructions
Get Expo Router navigation patterns. Call this when working with routes, navigation, deep links, or auth guards. Covers file structure, layouts, AuthGuard, typed params, navigation API, deep linking, and layout groups. Use topic to get a specific section only.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No | Get a specific section only. Available: file-routing, layouts, auth-guard, typed-params, navigation-api, deep-linking, groups. Omit for full content. | |
| compact | No | If true, returns rules only without code examples. Much shorter. |
Implementation Reference
- The handler function that retrieves the navigation pattern content based on a topic and compact flag.
export const getNavigationPatterns = (topic?: string, compact?: boolean): string => resolvePattern(pattern, topic, compact); - The definition of the content sections used by the tool.
const pattern: PatternSections = { title: 'Navigation Patterns (Expo Router)', sections, compactSections, }; - src/index.ts:77-95 (registration)Tool registration for "get-navigation-patterns" in the main server file.
server.tool( "get-navigation-patterns", "Get Expo Router navigation patterns. Call this when working with routes, navigation, deep links, or auth guards. Covers file structure, layouts, AuthGuard, typed params, navigation API, deep linking, and layout groups. Use `topic` to get a specific section only.", { topic: z .string() .optional() .describe( "Get a specific section only. Available: file-routing, layouts, auth-guard, typed-params, navigation-api, deep-linking, groups. Omit for full content." ), compact: z .boolean() .optional() .describe("If true, returns rules only without code examples. Much shorter."), }, async ({ topic, compact }) => ({ content: [{ type: "text", text: getNavigationPatterns(topic, compact) }], }) );