Skip to content

MCP API Reference

Complete reference for all 11 customer-facing Maguyva MCP tools. Each tool includes parameters, usage guidance, and best-for recommendations.

API Overview #

The Maguyva MCP API currently exposes 11 customer-facing tools across 4 main categories:

  • Core Search Tools - Advanced search capabilities across your codebase
  • Structural & Graph Tools - AST queries, symbol lookup, and dependency analysis
  • Code Analysis Tools - Deep code analysis and relationship mapping
  • System & Utility Tools - Repository context, deterministic compute, and guidance

All tools use a consistent repository identifier format: "owner/repo:branch". Branch defaults to main if not specified.

Repository Parameter Format #

All MCP tools use this repository identifier format:

  • With branch: "owner/repo:branch" - e.g., "owner/repository:develop"
  • Default branch: "owner/repo" - e.g., "owner/repository" (uses main branch)
  • Session context: Set default repository via repository_context tool

Example prompts:

Ask about a specific repo:  "Search owner/my-repo for authentication middleware"
Set a session default:      "Use owner/my-repo as my default repository"
Override for one query:     "Search owner/other-repo:develop for auth patterns"

Language Filtering #

All search tools support filtering results by programming language:

  • language_filter="python" - Filter to Python files only
  • language_filter="typescript" - Filter to TypeScript files only
  • Case-sensitive: Use lowercase language names
  • Default: Empty string (no filtering) - returns results from all languages
  • Supported coverage: Language filters work across the full 229+ supported languages and text-based technologies. See compatibility for the full list.
"Find authentication middleware in Python files only"
"Search for database connections in TypeScript"

API reference generated from source on March 27, 2026.

Core Search Tools #

START HERE — Multi-modal code search that auto-routes across semantic, text, AST, and graph. Combines search strategies with importance-aware ranking and dead code detection. Start here — auto-routes your question to the best search mode.

Parameters:

ParameterTypeRequiredDefaultDescription
querystrNo
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
modeLiteral[auto, semantic, text, ast, graph, hybrid]Noauto
qualitystrNobalanced
limitintNo-Max results
include_contentboolNo-
language_filterstrNo
path_filterstrNo
boost_by_importancebool | NoneNo-Rank results higher if they have many dependencies (high PageRank). Use for finding core utilities, widely-used interfaces, or important code.
orphansboolNoReturn symbols with no incoming references (potential dead code). Useful for cleanup but may include decorators, inner functions, CLI entry points.
min_coupling_scorefloatNo0Minimum bridging centrality threshold (0.0-1.0). Higher values only return coupling hotspots that connect different code communities.
include_community_contextboolNo-Include related symbols from the same code community for broader context. Helpful when exploring how a feature or module works.

Timeout: 60s

Find code by meaning using vector similarity. Use for conceptual queries like 'authentication flow' or 'error handling pattern' when you don't know exact text. Use when you need to find code by meaning rather than exact text.

Parameters:

ParameterTypeRequiredDefaultDescription
querystrNo
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
limitintNo-Max results (read-only)
similarity_thresholdfloatNo-
depthstrNo
include_contentboolNo-
boost_by_importanceboolNo-
language_filterstrNo
path_filterstrNo

Timeout: 30s

Search code by exact text, fuzzy match, or regex pattern. Use for known strings, error messages, identifiers, and grep-like queries. Use for regex patterns, exact strings, or when you know the specific text to find.

Parameters:

ParameterTypeRequiredDefaultDescription
querystrNo
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
search_scopeLiteral[content, symbols, files, auto]NocontentSearch scope: 'content' (code chunks, default), 'symbols' (function/class names), 'files' (file paths), 'auto' (system chooses).
modeLiteral[exact, fuzzy, regex]NoexactSearch mode: 'exact' (literal match), 'fuzzy' (similarity-based), 'regex' (pattern match). Note: fuzzy mode with search_scope='content' (the default) may route to semantic search for performance (23s→500ms). When routed, response metadata includes search_type='semantic_routed'.
case_sensitiveboolNo
language_filterstrNo
limitintNo-Max results
path_filterstrNo

Timeout: 30s

Structural & Graph Tools #

Search code structure by AST node type, symbol name, decorator, or base class. Use when you need structural precision — find all classes inheriting from X, functions with @decorator, or specific AST patterns. Use for AST pattern matching to find code by structure rather than text.

Parameters:

ParameterTypeRequiredDefaultDescription
patternstrNo
query_typeLiteral[node_type, name_pattern, parent_child]Nonode_typeSearch mode (auto-detected when omitted). Inferred from provided parameters: name_pattern → 'name_pattern', parent_type → 'parent_child', otherwise 'node_type'. Set explicitly to override auto-detection.
node_typestrNo
name_patternstrNo
parent_typestrNo
presetstrNo
decoratorstrNo
callee_textstrNo
callee_namestrNo
field_rolestrNo
ltree_ancestorstrNo
ltree_descendantstrNo
definition_namestrNo
base_classstrNo
min_depthintNo0
max_depthintNo0
repositorystrNo
branchstrNo
limitintNo-Max results (capped at 100-200 based on query type)
language_filterstrNo
path_filterstrNo

Timeout: 30s

Graph-powered dependency and relationship analysis with centrality ranking. Use for finding dependencies, impact radius, module boundaries, orphan detection, and coupling hotspots. Use for import tracking, caller/callee discovery, and coupling assessment.

Parameters:

ParameterTypeRequiredDefaultDescription
analysis_typestrNocentralityQuery mode: centrality|dependencies|modules|impact_radius|orphans
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
symbol_typestuple[str, Ellipsis] | list[str]NoSymbol type filter
limitintNo-Max graph nodes
min_centralityfloatNo0
find_similar_patternsboolNo
targetstr | NoneNo
directionstrNobothTraversal direction: 'outgoing' = what this symbol depends on (its dependencies), 'incoming' = what depends on this symbol (its dependents), 'both' = full context. Use 'incoming' to find all callers/users of a symbol.
depthint | str | NoneNoTraversal depth (1-3, or aliases: shallow, balanced, deep)
include_metricsbool | NoneNoInclude graph metrics
language_filterstrNo
relationship_typestuple[str, Ellipsis] | list[str] | NoneNoExplicit edge types (e.g., CALL, IMPORT). Overrides analysis_type if provided.
exact_matchboolNoRequire exact symbol name match (case-insensitive). Disables fuzzy matching
path_filterstrNo
exclude_test_pathsboolNoExclude common test/fixture paths from results. When true, filters paths matching fixtures/, test_fixtures/, __fixtures__/. Default false (no filtering).

Timeout: 60s

Code Analysis Tools #

find_symbol Stable

Look up symbol definitions and references with graph metrics. Use when you know the exact function, class, or variable name and need its location, callers, or importance.

Parameters:

ParameterTypeRequiredDefaultDescription
symbol_namestrNo
symbol_typestrNo
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
scopestrNoboth
limitintNo-Max results
find_similarboolNo
include_metricsboolNo
high_impactboolNo
in_cycleboolNo
path_filterstrNo

Timeout: 30s

analyze_dependencies Stable

Analyze import chains and dependency relationships for a symbol or directory. Use for understanding module coupling and dependency depth. Use for comprehensive dependency analysis of a file or symbol.

Parameters:

ParameterTypeRequiredDefaultDescription
targetstrYes-Symbol or module name to analyze (e.g., 'SupabaseService', 'get_config'). Use symbol names for reliable results.
analysis_typestrNoimports
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
depthintNo1Analysis depth (supports aliases: auto, shallow/quick=1, balanced/medium=2, deep/thorough=3)
directionstrNoboth
limitintNo-Max relationships
include_metricsboolNo
language_filterstrNo
relationship_typeslist[str] | tuple[str, Ellipsis] | NoneNoExplicit edge types (e.g., CALL, IMPORT). Overrides analysis_type if provided.

Timeout: 60s

get_task_context Stable

Gather multi-layered context for a task description. Combines semantic search, symbol lookup, and dependency analysis in one call. Use when working on a specific task to get relevant context snippets.

Parameters:

ParameterTypeRequiredDefaultDescription
task_descriptionstrYes-
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
scopelist[str] | strNo
language_filterstrNo
include_related_contextboolNoInclude related context (neighbors + community members)
limitint | NoneNo0Max context items

Timeout: 60s

get_file Stable

Retrieve file content with optional line range and metadata. Use for reading specific source files or code sections. Use to read a specific file's content from the indexed repository.

Parameters:

ParameterTypeRequiredDefaultDescription
file_pathstrYes-
repositorystrNo'owner/repo' or 'owner/repo:branch'. Session default if omitted.
branchstrNoBranch name (leave blank to use the session or repository default).
line_rangelist[int] | dict[str, int] | str | NoneNo[start, end] or 'start-end'
max_tokensintNo-
include_metadataboolNotrue
include_syntax_highlightingboolNo
chunk_startintNo0

Timeout: 60s

System & Utility Tools #

repository_context Stable

Manage repository session context — list, set, set_default, or inspect available repositories and branches. Call this first to set your session's default repository.

Parameters:

ParameterTypeRequiredDefaultDescription
actionLiteral[list, set, set_default, info]Yes-
repositorystrNo
branchstrNo
patternstr | NoneNo
include_statsboolNoInclude statistics
limitintNo-Max repositories
include_graph_metricsboolNoInclude graph topology metrics in info response

Timeout: 30s

ask_maguyva Stable

Guidance and deterministic compute (hash, base64, uuid, json, math). Use 'guidance' operation for tool usage help.

Parameters:

ParameterTypeRequiredDefaultDescription
operationstrYes-One of guidance, hash, base64, uuid, json, math
topicstrNo
textstrNo
hash_typestrNo
base64_operationstrNo
uuid_versionintNo0
uuid_namespacestrNo
uuid_namestrNo
json_textstrNo
json_indentintNo0
math_operationstrNo
math_valuefloatNo0
math_value_aintNo0
math_value_bintNo0
math_exponentfloatNo0

Timeout: 30s

Best Practices #

  1. Use Repository Context: Set a session default repository to avoid repeating it in every call.
  2. Choose the Right Search Mode: Use intelligent_search with mode="auto" for most cases. Specify a mode when you know exactly what you need.
  3. Leverage Language Filters: Use language_filter to narrow results and improve performance.
  4. GraphRAG Boosting: GraphRAG importance boosting is enabled by default for semantic search. Set boost_by_importance=False to disable it for pure vector similarity.
  5. Fuzzy Resolution Is Built-In: repository_context automatically resolves close repository matches to handle minor typos.
  6. Combine Tools: Use multiple API methods together for comprehensive analysis.
  7. Handle Large Results: Use limit and tool-specific paging controls (for example chunk_start in get_file).
  8. Deterministic Operations: Use ask_maguyva for hash, base64, JSON, and math operations to avoid hallucination.

Performance Characteristics #

Operation Latency
Semantic search Sub-second
Text search Sub-second
Structural search Fast (optimized AST indexing)
Dependency search Efficient (depth limiting)
File retrieval Near-instant
Repository context Cached
ask_maguyva (deterministic ops) Near-instant (local compute)

Error Handling #

All API methods return structured responses with:

  • success: Boolean indicating operation success
  • data: Result data when successful
  • error: Error message if operation failed
  • metadata: Additional information about the operation

Always check the success field before processing results.

Getting Started #

  1. Configure MCP Client: Point your MCP client to the Maguyva server endpoint
  2. Set Repository Context: Use repository_context to set your default repository
  3. Start Searching: Begin with intelligent_search and explore specialized tools as needed
  4. Combine Tools: Use multiple tools together for comprehensive code analysis

For detailed integration instructions, see the installation guide.

MAGUYVA.NFO